[Phillip]
> 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.

Maybe if you drop support for the "separate protocol" alternative... :-)

I had never heard of that PEP. How much code is there in the field?
Written by whom?

I suppose you can always write a decorator that takes care of the
mapping. I suppose it should catch and ignore the StopIteration that
__exit__(StopIteration) is likely to throw.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to