[Python-ideas] Yield-From: Finalization guarantees

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 31 02:23:48 CEST 2009

Jacob Holm wrote:

> Even without changing throw and close, I still think we should forward 
> GeneratorExit like any other exception, and not do anything special to 
> reraise it or call close on the subiterator.

But that allows you to inadvertently create a broken
generator by calling another generator that, according to
the rules you've just acknowledged we can't change, is
behaving correctly.

Asking users not to call such generators would require
them to have knowledge about the implementation of every
generator they call, which I don't think is acceptable.


More information about the Python-ideas mailing list