Nick Coghlan wrote: > On Fri, Mar 9, 2012 at 12:06 AM, Mark Shannon <mark at hotpy.org> wrote: >> The text of the PEP seems to implicitly assume that all sub-iterators >> will be generators, so it is not clear on the above points. > > On the contrary, this question is explicitly addressed in the PEP: > http://www.python.org/dev/peps/pep-0380/#finalization I should have read it more carefully. > > If you want to block an inadvertent close() call, you need to either > wrap the object so it doesn't implement unwanted parts of the > generator API (which is the iterator protocol plus send(), throw() and > close()), or else you should continue to use simple iteration rather > than delegation. > What about the exception being suppressed? That doesn't seem to be mentioned. Cheers, Mark.
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