[Python-ideas] Yield-From: Finalization guarantees

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Mar 28 00:58:05 CET 2009

Nick Coghlan wrote:
> The part that
> isn't clicking for me is that I still don't understand *why* 'yield
> from' should include implicit finalisation as part of its definition.
 > It's the generalisation of that to all other iterators that happen to
 > offer a close() method that seems somewhat arbitrary.

It's a matter of opinion. I would find it surprising if
generators behaved differently from all other iterators
in this respect. It would be un-ducktypish.

I think we need a BDFL opinion to settle this one.


More information about the Python-ideas mailing list