Simple if-else question

Carl Banks pavlovevidence at gmail.com
Tue Sep 29 15:14:42 EDT 2009


On Sep 29, 10:38 am, Duncan Booth <duncan.bo... at invalid.invalid>
wrote:
> Carl Banks <pavlovevide... at gmail.com> wrote:
> > Hmm, I wonder if Python should emit a warning if an else is used on a
> > for block with no break inside.  I don't think the else can be invoked
> > in any other way.  As a bonus it could catch some cases where people
> > mistakenly use it thinking it will execute when there are no
> > iterations.
>
> It will execute when there are no iterations. Did you mean to say people
> think it will execute *only* when there are no iterations?


No but that's what I should have meant.


Carl Banks






More information about the Python-list mailing list