[Python-ideas] Possible PEP 380 tweak

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Oct 29 07:25:56 CEST 2010


Guido van Rossum wrote:

> I'd also like to convince you to change g.close() so that it captures
> and returns the return value from StopIteration if it has one.

Looking at this again, I find that I'm not really sure how
this impacts PEP 380. The current expansion specifies that
when a delegating generator is closed, the subgenerator's
close() method is called, any value it returns is ignored,
and GeneratorExit is re-raised.

If that close() call were to return a value, what do you
think should be done with it?

-- 
Greg



More information about the Python-ideas mailing list