[issue7525] Yield example doesn't work as is explained in the documentation

xiscu report at bugs.python.org
Wed Dec 16 16:09:24 CET 2009


New submission from xiscu <xiscu at email.de>:

In the documentation the is:

...
>>>generator.throw(TypeError, "spam")
TypeError('spam',)
>>> generator.close()
Don't forget to clean up when 'close()' is called.
...

I'm getting:
>>>generator.throw(TypeError, "spam")
TypeError('spam',)
>>> generator.close()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: generator ignored GeneratorExit
...

My proposal here is yield_example_1.py

Thanks

----------
assignee: georg.brandl
components: Documentation
files: yield_example_1.py
messages: 96489
nosy: georg.brandl, xiscu
severity: normal
status: open
title: Yield example doesn't work as is explained in the documentation
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file15576/yield_example_1.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7525>
_______________________________________


More information about the Python-bugs-list mailing list