Guido van Rossum <gu...@python.org> added the comment:

So this is a problem because the generator owns a resource that it will only 
release once its .close() method is called, right? And we have no control over 
when that happens -- we can't make it the responsibility of list() to close the 
iterator passed into it. It is indeed a painful thing. I wonder if we should 
put a warning somewhere in the docs and tutorials for generators?

The PR looks good.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44482>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to