[Python-ideas] Yield-From: Finalization guarantees

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 26 00:35:34 CET 2009


Jacob Holm wrote:
> It 
> fails to handle the case where the throw raises a StopIteration (or 
> there is no throw method and the thrown exception is a StopIteration).

No, I think it does the right thing in that case. By the
inlining principle, the StopIteration should be thrown
in like anything else, and if it propagates back out,
it should stop the delegating generator, *not* the
subiterator.

-- 
Greg



More information about the Python-ideas mailing list