[Cython] 'with gil:' statement

mark florisson markflorisson88 at gmail.com
Fri Mar 18 10:52:16 CET 2011

On 18 March 2011 07:07, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Greg Ewing, 18.03.2011 01:18:
>> mark florisson wrote:
>>> I think we could support it without having to acquire
>>> the GIL in the finally clause.
>> That was the intention -- the code in the finally clause would
>> be subject to the same nogil restrictions as the rest of
>> the nogil block.
>> My point is that as long as you're allowing exceptions to be
>> tunnelled through nogil blocks, they should respect any finally
>> clauses that they pass through on the way.
> +1

Ok, I will give it a go and try to allow it when they surround with
gil blocks. I would however like to reiterate that it is a
special-case, inconsistent with previous behaviour, and basically
extends the language and won't work for functions that are called and
declared 'with gil'. But it is convenient, so I can't help but like it
at the same time :]

> Stefan
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel

More information about the cython-devel mailing list