[Python-Dev] PEP 340: Deterministic Finalisation (new PEP draft, either a competitor or update to PEP 340)
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon May 9 09:13:09 CEST 2005
Nick Coghlan wrote:
> "Loop on this iterator and finalise when done" would be written:
>
> for item in itr:
> process(item)
> finally:
> pass
This is approaching things from the wrong end. The user of
an iterator shouldn't need to know or care whether it
requires finalization -- it should Just Work, whatever
context it is used in.
Greg
More information about the Python-Dev
mailing list