[Python-ideas] Possible PEP 380 tweak

Nick Coghlan ncoghlan at gmail.com
Thu Oct 28 00:54:30 CEST 2010


On Thu, Oct 28, 2010 at 8:52 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Thu, Oct 28, 2010 at 6:22 AM, Jacob Holm <jh at improva.dk> wrote:
>> Actually, AFAICT outer_broken will *not* give a RuntimeError on close()
>> after next().  This is due to the special-casing of GeneratorExit in PEP
>> 380.  That special-casing is also the basis for both my suggested
>> modifications.
>
> Ah, you're quite right - I'd completely forgotten about the
> GeneratorExit special-casing in the PEP 380 semantics, so I was
> arguing from a faulty premise. With that error corrected, I can
> happily withdraw my objection to idioms that convert GeneratorExit to
> StopIteration (since any yield from expressions will reraise the
> GeneratorExit in that case).

Correction: they'll reraise StopIteration with the current PEP
semantics, GeneratorExit with the proposed modification at the end of
my last message.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list