[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/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4