[Python-Dev] PEP 340 -- concept clarification
Phillip J. Eby
pje at telecommunity.com
Wed May 4 00:02:56 CEST 2005
At 05:30 PM 5/3/05 -0400, Raymond Hettinger wrote:
>By comparision, g.throw() or g.close() are trivially simple approaches
>to generator/iterator finalization.
That reminds me of something; in PEP 333 I proposed use of a 'close()'
attribute in anticipation of PEP 325, so that web applications implemented
as generators could take advantage of resource cleanup. Is there any
chance that as part of PEP 340, 'close()' could translate to the same as
'__exit__(StopIteration)'? If not, modifying PEP 333 to support '__exit__'
is going to be a bit of a pain, especially since there's code in the field
now with that assumption.
More information about the Python-Dev
mailing list