Re: [Cython] [GSoC] Python backend for Cython using PyPy's FFI

2011-04-18 Thread Stefan Behnel
Romain Guillebert, 07.04.2011 17:01: I proposed the Summer of Code project regarding the Python backend for Cython. As I said in my proposal this would translate Cython code to Python + FFI code (I don't know yet if it will use ctypes or something specific to PyPy). PyPy's ctypes is now really f

Re: [Cython] prange CEP updated

2011-04-18 Thread mark florisson
On 16 April 2011 18:42, Dag Sverre Seljebotn wrote: > (Moving discussion from http://markflorisson.wordpress.com/, where Mark > said:) Ok, sure, it was just an issue I was wondering about at that moment, but it's a tricky issue, so thanks. > """ > Started a new branch https://github.com/markflor

Re: [Cython] Recent bugs in generators

2011-04-18 Thread Vitja Makarov
2011/4/18 Stefan Behnel : > Vitja Makarov, 18.04.2011 06:38: >> >> 2011/4/18 Stefan Behnel: >>> >>> Vitja Makarov, 17.04.2011 17:57: 3. check_yield_in_exception() >>> >>> I added this because I found a failing pyregr test that uses it (testing >>> the >>> @contextmanager decorator). >>> >

Re: [Cython] prange CEP updated

2011-04-18 Thread mark florisson
On 18 April 2011 13:06, mark florisson wrote: > On 16 April 2011 18:42, Dag Sverre Seljebotn > wrote: >> (Moving discussion from http://markflorisson.wordpress.com/, where Mark >> said:) > > Ok, sure, it was just an issue I was wondering about at that moment, > but it's a tricky issue, so thanks

Re: [Cython] prange CEP updated

2011-04-18 Thread Dag Sverre Seljebotn
(apologies for top post) This all seems to scream 'disallow' to me, in particular since some openmp implementations may not support it etc. At any rate I feel 'parallel/parallel/prange/prange' is going to far; so next step could be to only allowing 'parallel/prange/parallel/prange'. But really

Re: [Cython] prange CEP updated

2011-04-18 Thread mark florisson
On 18 April 2011 16:01, Dag Sverre Seljebotn wrote: > (apologies for top post) No problem, it means I have to scroll less :) > This all seems to scream 'disallow' to me, in particular since some openmp > implementations may not support it etc. > > At any rate I feel 'parallel/parallel/prange/pra

Re: [Cython] prange CEP updated

2011-04-18 Thread Dag Sverre Seljebotn
Excellent! Sounds great! (as I won't have my laptop for some days I can't have a look yet but I will later) You're right about (the current) buffers and the gil. A testcase explicitly for them would be good. Firstprivate etc: i think it'd be nice myself, but it is probably better to take a bre

Re: [Cython] prange CEP updated

2011-04-18 Thread mark florisson
On 18 April 2011 16:41, Dag Sverre Seljebotn wrote: > Excellent! Sounds great! (as I won't have my laptop for some days I can't > have a look yet but I will later) > > You're right about (the current) buffers and the gil. A testcase explicitly > for them would be good. > > Firstprivate etc: i thin

Re: [Cython] [GSoC] Python backend for Cython using PyPy's FFI

2011-04-18 Thread Romain Guillebert
Hi I investigated the code produced by Cython, and I see 3 cases which should be handled : * A pure python variable which has a value assigned (including None) * A pure python variable which has no value assigned * A C variable (we can't test if they are set of not) The first and second one seem

[Cython] gilnanny

2011-04-18 Thread mark florisson
Can I add a gilnanny to refnanny? I want to do a PyThreadState_Get() for every refnanny inc- and decref, so that it will issue a fatal error whenever reference counting is done without the gil, to make sure we never do any illegal things in nogil code blocks. While I'm at it, I also want to add a p

Re: [Cython] gilnanny

2011-04-18 Thread Robert Bradshaw
On Mon, Apr 18, 2011 at 12:08 PM, mark florisson wrote: > Can I add a gilnanny to refnanny? I want to do a PyThreadState_Get() > for every refnanny inc- and decref, so that it will issue a fatal > error whenever reference counting is done without the gil, to make > sure we never do any illegal thi

Re: [Cython] gilnanny

2011-04-18 Thread Sturla Molden
Den 18.04.2011 22:26, skrev Robert Bradshaw: On Mon, Apr 18, 2011 at 12:08 PM, mark florisson wrote: Can I add a gilnanny to refnanny? I want to do a PyThreadState_Get() for every refnanny inc- and decref, so that it will issue a fatal error whenever reference counting is done without the gil,

Re: [Cython] gilnanny

2011-04-18 Thread Stefan Behnel
Sturla Molden, 19.04.2011 00:18: Den 18.04.2011 22:26, skrev Robert Bradshaw: On Mon, Apr 18, 2011 at 12:08 PM, mark florisson wrote: Can I add a gilnanny to refnanny? I want to do a PyThreadState_Get() for every refnanny inc- and decref, so that it will issue a fatal error whenever reference c

Re: [Cython] Recent bugs in generators

2011-04-18 Thread Stefan Behnel
Vitja Makarov, 18.04.2011 15:19: There is one more interesting thing: def test_yield_inside_genexp(): """ >>> o = test_yield_inside_genexp() >>> list(o) [0, None, 1, None, 2, None] """ return ((yield i) for i in range(3)) Impressively ugly. I guess we should st

Re: [Cython] Recent bugs in generators

2011-04-18 Thread Vitja Makarov
2011/4/19 Stefan Behnel : > Vitja Makarov, 18.04.2011 15:19: >> >> There is one more interesting thing: >> >> def test_yield_inside_genexp(): >>     """ >>     >>>  o = test_yield_inside_genexp() >>     >>>  list(o) >>     [0, None, 1, None, 2, None] >>     """ >>     return ((yield i) for i in ran

Re: [Cython] [GSoC] Python backend for Cython using PyPy's FFI

2011-04-18 Thread Stefan Behnel
Romain Guillebert, 18.04.2011 17:55: I investigated the code produced by Cython, and I see 3 cases which should be handled : * A pure python variable which has a value assigned (including None) * A pure python variable which has no value assigned * A C variable (we can't test if they are set of