[issue22988] No error when yielding from `finally`

2015-01-14 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue22988] No error when yielding from `finally`

2015-01-14 Thread Ethan Furman
Changes by Ethan Furman : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue22988] No error when yielding from `finally`

2015-01-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e48b0908651 by Ethan Furman in branch '3.4': Issue22988: clarify yield and exception blocks https://hg.python.org/cpython/rev/0e48b0908651 New changeset 55ba19d084fb by Ethan Furman in branch 'default': Issue22988: clarify yield and exception block

[issue22988] No error when yielding from `finally`

2014-12-03 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue22988] No error when yielding from `finally`

2014-12-03 Thread Felipe
Felipe added the comment: Thanks for the clarification; sorry I misread issue #14718. I agree with Ethan's point. Though I would say "Yield expressions are allowed anywhere in try ... except ... finally constructs." I'd also like to explicitly add a point about the exception-handling machinery

[issue22988] No error when yielding from `finally`

2014-12-03 Thread Ethan Furman
Ethan Furman added the comment: 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 gar

[issue22988] No error when yielding from `finally`

2014-12-03 Thread R. David Murray
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

[issue22988] No error when yielding from `finally`

2014-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: There is no prohibition in the language against yield in a finally block. It may not be a good idea, but the behavior you see is all as it should be. -- ___ Python tracker _

[issue22988] No error when yielding from `finally`

2014-12-03 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman, giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov ___ Python tracker ___ ___ P

[issue22988] No error when yielding from `finally`

2014-12-03 Thread Felipe
New submission from Felipe: This bug report is the opposite of issue #14718. The interpreter did not raise an error when it encountered a `yield` expression inside the `finally` part of a `try/finally` statement. My system's info: Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC