Re: [Python-Dev] [Python-ideas] PEP 479: Change StopIteration handling inside generators

2014-11-19 Thread Chris Angelico
On Thu, Nov 20, 2014 at 3:45 AM, Nick Coghlan wrote: > The part I found most compelling was when you pointed out that in the > special method implementations, the normal return path was always spelled > with "return", while the "value missing" result was indicated with a special > kind of exceptio

Re: [Python-Dev] PEP 479: Change StopIteration handling inside generators

2014-11-19 Thread Chris Angelico
On Thu, Nov 20, 2014 at 7:48 AM, MRAB wrote: > The PEP says """any generator that depends on an implicitly-raised > StopIteration to terminate it will have to be rewritten to either catch > that exception or use a for-loop""" > > Shouldn't that be "... explicitly-raised ...", because returning rai

Re: [Python-Dev] PEP 479: Change StopIteration handling inside generators

2014-11-19 Thread MRAB
On 2014-11-19 20:10, Guido van Rossum wrote: There's a new PEP proposing to change how to treat StopIteration bubbling up out of a generator frame (not caused by a return from the frame). The proposal is to replace such a StopIteration with a RuntimeError (chained to the original StopIteration),

Re: [Python-Dev] PEP 479: Change StopIteration handling inside generators

2014-11-19 Thread Benjamin Peterson
On Wed, Nov 19, 2014, at 15:10, Guido van Rossum wrote: > There's a new PEP proposing to change how to treat StopIteration bubbling > up out of a generator frame (not caused by a return from the frame). The > proposal is to replace such a StopIteration with a RuntimeError (chained > to > the orig

[Python-Dev] PEP 479: Change StopIteration handling inside generators

2014-11-19 Thread Guido van Rossum
There's a new PEP proposing to change how to treat StopIteration bubbling up out of a generator frame (not caused by a return from the frame). The proposal is to replace such a StopIteration with a RuntimeError (chained to the original StopIteration), so that only *returning* from a generator (or f