Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:
This is not a bug. It is an implementation specific detail and is not guaranteed behavior. The submitted "example bug" is horrible code that makes unwarranted assumptions about the implementation -- it is an anti-pattern to write generators that assume that their consumers will run them to exhaustion so that cleanup code will be executed -- a number of tools violate this assumption. If you're relying on this technique for cleanup, you're doing it wrong. I'll look at this again after the 3.2 release. When it was discussed before, the outcome was to introduce itertools.zip_longest() and to not over-document non-guaranteed implementation specific details (lest people rely on them and write code even worse than the OP's example). ---------- assignee: docs@python -> rhettinger nosy: +rhettinger priority: normal -> low type: behavior -> feature request _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11248> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com