Message232086
Here's the excerpt from the docs:
--------------------------------
> Yield expressions are 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, allowing any pending finally clauses to execute.
This certainly makes it sound like 'yield' is okay in the 'try' portion, but not the 'finally' portion.
So 'yield' is allowed in the 'try' portion, and it's allowed in the 'finally' portion -- is it also allowed in the 'except' portion? If so, we could simplify the first line to:
> Yield expressions are allowed in try ... except ... finally constructs. |
|
Date |
User |
Action |
Args |
2014-12-03 19:05:41 | ethan.furman | set | recipients:
+ ethan.furman, gvanrossum, pitrou, vstinner, giampaolo.rodola, r.david.murray, docs@python, yselivanov, fov |
2014-12-03 19:05:41 | ethan.furman | set | messageid: <1417633541.42.0.915549597985.issue22988@psf.upfronthosting.co.za> |
2014-12-03 19:05:41 | ethan.furman | link | issue22988 messages |
2014-12-03 19:05:41 | ethan.furman | create | |
|