[Python-ideas] possible extension to how the new StopIteration is handled (python >=3.3)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Oct 3 00:15:05 CEST 2014


Chris Angelico wrote:
> it
> would mean that the generator would have to retain a reference to its
> return value, which is contrary to what most people will expect of
> function return values. It might make for unnecessary object
> longevity.

This was debated during the yield-from discussions and
decided against. If I remember rightly, unexpected longevity
of return values was one of the main objections.

-- 
Greg


More information about the Python-ideas mailing list