[Python-Dev] Re: anonymous blocks

Nick Coghlan ncoghlan at gmail.com
Thu Apr 28 14:08:08 CEST 2005


Brett C. wrote:
>>I'm surprisingly close to agreeing with you, actually. I've worked out
>>that it isn't the looping that I object to, it's the inability to get
>>out of the loop without exhausting the entire iterator.

> 'break' isn't' enough for you as laid out by the proposal?  The raising of
> StopIteration, which is what 'break' does according to the standard, should be
> enough to stop the loop without exhausting things.  Same way you stop a 'for'
> loop from executing entirely.

The StopIteration exception effectively exhausted the generator, though. 
However, I've figured out how to deal with that, and my reservations about PEP 
340 are basically gone.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net


More information about the Python-Dev mailing list