[docs] [issue22988] No error when yielding from `finally`

R. David Murray report at bugs.python.org
Wed Dec 3 19:49:57 CET 2014


R. David Murray added the comment:

FIlipe, in case you hadn't noticed, the reason for the error in the other issue is that the generator was closed when it got garbage collected, and it ignored the close (executed a yield after the close).  Thus the error message there is accurate and expected, just as (as Guido said) the behavior here is consistent with the combined semantics of generators and try/finally.

Do you want to suggest an improvement to the docs?  It may be that we'll decide a change is more confusing than helpful, but we'll need someone to suggest a wording to decide that.

----------
assignee:  -> docs at python
components: +Documentation -Interpreter Core
nosy: +docs at python, r.david.murray
versions: +Python 3.5

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


More information about the docs mailing list