Re: [Cython] 'with gil:' statement

2011-03-17 Thread Dag Sverre Seljebotn
On 03/17/2011 09:27 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 17.03.2011 08:38: On 03/17/2011 12:24 AM, Greg Ewing wrote: Stefan Behnel wrote: I'm not sure if this is a good idea. nogil blocks don't have a way to handle exceptions, so simply jumping out of them because an inner 'with

Re: [Cython] 'with gil:' statement

2011-03-17 Thread Dag Sverre Seljebotn
On 03/17/2011 11:16 AM, mark florisson wrote: On 17 March 2011 10:08, Dag Sverre Seljebotnd.s.seljeb...@astro.uio.no wrote: How about this compromise: We balk on the code you wrote with: Error line 345: Exceptions propagating from with gil block cannot be propagated out of function, please

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-17 Thread Jason Grout
On 3/16/11 11:05 PM, Robert Bradshaw wrote: On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnelstefan...@behnel.de wrote: I'm actually leaning towards not guaranteeing the order of execution if C doesn't do it either. If this is really required, it's easy to work around for users, but it's severely

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-17 Thread Robert Bradshaw
On Thu, Mar 17, 2011 at 6:15 AM, Jason Grout jason-s...@creativetrax.com wrote: On 3/16/11 11:05 PM, Robert Bradshaw wrote: On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnelstefan...@behnel.de  wrote: I'm actually leaning towards not guaranteeing the order of execution if C doesn't do it

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-17 Thread Vitja Makarov
2011/3/17 Robert Bradshaw rober...@math.washington.edu: On Thu, Mar 17, 2011 at 6:15 AM, Jason Grout jason-s...@creativetrax.com wrote: On 3/16/11 11:05 PM, Robert Bradshaw wrote: On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnelstefan...@behnel.de  wrote: I'm actually leaning towards not

Re: [Cython] 'with gil:' statement

2011-03-17 Thread mark florisson
On 16 March 2011 20:16, mark florisson markflorisso...@gmail.com wrote: Could someone review the patch (which is attached)? Maybe check if I haven't missed any side cases and such? From a first look, the test file you added seems far too short. I would expect that this feature requires a lot

Re: [Cython] 'with gil:' statement

2011-03-17 Thread Greg Ewing
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