On Fri, Mar 9, 2012 at 12:06 AM, Mark Shannon <m...@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

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.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
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