[Python-ideas] Protecting finally clauses of interruptions

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 4 02:03:29 CEST 2012

Paul Colomiets wrote:

> So I still propose add a frame flag, which doesn't break
> anything, and gives us experiment with interruptions
> without putting some experimental code into the core.

I don't think a frame flag on its own is quite enough.
You don't just want to prevent interruptions while in
a finally block, you want to defer them until the finally
counter gets back to zero. Making the interrupter sleep
and try again in that situation is rather ugly.

So perhaps there could also be a callback that gets
invoked when the counter goes down to zero.


More information about the Python-ideas mailing list