[Python-ideas] Yield-From: Finalization guarantees

Guido van Rossum guido at python.org
Sun Mar 29 04:50:16 CEST 2009


On Fri, Mar 27, 2009 at 6:58 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 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.

To be honest, I don't follow this in detail yet, but I believe I don't
really care that much either way, and I'd like to recommend that you
do whatever makes the specification (and hence hopefully the
implementation) have the least special cases. There are several Python
Zen rules about this. :-)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-ideas mailing list