Simple if-else question

Duncan Booth duncan.booth at invalid.invalid
Tue Sep 29 19:38:17 CEST 2009


Carl Banks <pavlovevidence 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?



More information about the Python-list mailing list