[Python-ideas] for/else syntax

Michael Foord fuzzyman at gmail.com
Fri Oct 2 14:58:24 CEST 2009


2009/10/2 Yuvgoog Greenle <ubershmekel at gmail.com>

> I think I understand what you're saying and I just don't understand how it
> pertains to for..else. Specifically I would like an explanation about why
> the following quote is nonsense to you.
>

Hmm... on consideration, breaking out of a loop without a break (i.e.
exception or return) wouldn't enter the else clause *anyway*, so there is
still no need for the else clause.

My apologies, I retract. :-)

Michael


>
> 2009/10/2 Stephen J. Turnbull <stephen at xemacs.org>
>
>  Yuvgoog Greenle writes:
>>
>>  > 1. Not allowing a for loop that has no "break" to have an "else". Just
>> like
>>  > "else" isn't allowed when there isn't an "except" in the "try". There
>> really
>>  > is no excuse, justification or sense in a "for" loop that has no
>> "break" yet
>>  > has an "else".
>>
>> +1.  File an RFE against PyLint for sure, and against Python too.
>> That's a *great* idea!
>>
>
>
>


-- 
http://www.ironpythoninaction.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20091002/d4739936/attachment.html>


More information about the Python-ideas mailing list