[Python-ideas] Revised**7 PEP on Yield-From

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 22 09:15:42 CET 2009


Nick Coghlan wrote:

> The syntax shouldn't be trying to second guess
> whether or not calling close() is necessary or not - it should just be
> calling it, period.

But *why* should it be called? Just as calling close() after
the iterator has finished shouldn't do any harm, *not* doing
so shouldn't do any harm either, and some implementation
strategies (my current one included) would have to go out
of their way to call close() in that case.

-- 
Greg



More information about the Python-ideas mailing list