Terry J. Reedy <tjre...@udel.edu> added the comment: Calling g.close() is pointless for a generator used in normal pull mode and run to completion, as in the example. The generator is already 'closed', so g.close() does not do anything useful. See http://docs.python.org/py3k/reference/expressions.html#yield-expressions
The method was added to be used with .send() so that generators used in push mode could be told to finish up when there is nothing more to send. For such rare uses, contextlib.closing should usually be sufficient, I think. So I think this issue should be closed. ---------- nosy: +terry.reedy stage: -> test needed status: open -> pending _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13814> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com