This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Anssi.Kääriäinen, amaury.forgeotdarc, benjamin.peterson, docs@python, isoschiz, ncoghlan, pconnell, pitrou, vstinner
Date 2013-04-20.15:12:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1366470740.88.0.874457532153.issue17468@psf.upfronthosting.co.za>
In-reply-to
Content
To get back to Anssi's original suggestion... I think Anssi's proposal to allow finalisation to be skipped for try/except/else is legitimate. It's only finally clauses that we try to guarantee will execute, there's no such promise implied for ordinary except clauses.

We *don't care* if the generator *would* have caught the thrown GeneratorExit, we only care about ensuring that finally blocks are executed (including those implied by with statements). So if there aren't any finally clauses or with statements in the block stack, we should be able to just let the generator and frame get collected (as Anssi suggested), without trying to allow execution to complete.
History
Date User Action Args
2013-04-20 15:12:20ncoghlansetrecipients: + ncoghlan, amaury.forgeotdarc, pitrou, vstinner, benjamin.peterson, docs@python, Anssi.Kääriäinen, pconnell, isoschiz
2013-04-20 15:12:20ncoghlansetmessageid: <1366470740.88.0.874457532153.issue17468@psf.upfronthosting.co.za>
2013-04-20 15:12:20ncoghlanlinkissue17468 messages
2013-04-20 15:12:20ncoghlancreate