[Python-ideas] Yield-From: Finalization guarantees

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 24 00:24:53 CET 2009


We have a decision to make. It appears we can have
*one* of the following, but not both:

(1) In non-refcounting implementations, subiterators
are finalized promptly when the delegating generator
is explicitly closed.

(2) Subiterators are not prematurely finalized when
other references to them exist.

Since in the majority of intended use cases the
subiterator won't be shared, (1) seems like the more
important guarantee to uphold. Does anyone disagree
with that?

Guido, what do you think?

-- 
Greg



More information about the Python-ideas mailing list