[Python-ideas] Protecting finally clauses of interruptions

Yury Selivanov yselivanov.ml at gmail.com
Wed Apr 4 22:07:19 CEST 2012

On 2012-04-04, at 2:44 PM, Paul Colomiets wrote:

> But anyway I don't see a reason to protect a single frame,
> because even if you have a simple mutex without coroutines
> you end up with:

BTW, for instance, in our framework each coroutine is a special
object that wraps generator/plain function.  It controls everything
that the underlying generator/function yields/returns.  But the actual
execution, propagation of returned values and raised errors is the
scheduler's job.  So when you are yielding a coroutine from another 
coroutine, frames are not even connected to each other, since the 
actual execution of the callee will be performed by the scheduler.  
It's not like a regular python call.

For us, having 'f_in_finally' somehow propagated would be completely 

I think even if it's decided to implement just your proposal, I feel
that 'f_in_finally' should indicate the state of only its *own* frame.


More information about the Python-ideas mailing list