Nikolaus Rath <nikol...@rath.org> added the comment: >From http://www.python.org/dev/peps/pep-0342/ I believe that the last yield >will raise GeneratorExit. So my suggestion is to replace the above mentioned >paragraph with:
""" As of Python version 2.5, yield is an expression rather than a statement and allowed in the try clause of a try ... finally construct. If the generator is not resumed before it is finalized (by reaching a zero reference count or by being garbage collected), the generator-iterator’s close() method will be called, and the yield expression in the generator function will raise GeneratorExit. If the generator function raises GeneratorExit (either directly or by not catching it), future calls to the next() method of the generator iterator will raise StopIteration. GeneratorExit exceptions raised by the generator function are catched internally and do not result in a call to sys.excepthook. """ ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12704> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com