Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Robert Bradshaw
On Mon, May 7, 2012 at 9:41 PM, Stefan Behnel wrote: > Greg Ewing, 08.05.2012 02:05: >> Stefan Behnel wrote: >> >>> The main reason we didn't change this behaviour back then was that it would >>> clearly break user code and we thought we could do without that. That's >>> different from considering

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Stefan Behnel
mark florisson, 07.05.2012 19:13: > On 7 May 2012 18:06, Stefan Behnel wrote: >> mark florisson, 07.05.2012 18:18: >>> On 7 May 2012 17:16, mark florisson wrote: On 7 May 2012 17:12, Stefan Behnel wrote: > Dag Sverre Seljebotn, 07.05.2012 18:07: >> On 05/07/2012 06:04 PM, mark floriss

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Stefan Behnel
Greg Ewing, 08.05.2012 02:05: > Stefan Behnel wrote: > >> The main reason we didn't change this behaviour back then was that it would >> clearly break user code and we thought we could do without that. That's >> different from considering it "right" and "good". > > I changed the None-checking beh

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Robert Bradshaw
On Mon, May 7, 2012 at 5:05 PM, Greg Ewing wrote: > Stefan Behnel wrote: > >> The main reason we didn't change this behaviour back then was that it >> would >> clearly break user code and we thought we could do without that. That's >> different from considering it "right" and "good". > > I changed

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Greg Ewing
Stefan Behnel wrote: The main reason we didn't change this behaviour back then was that it would clearly break user code and we thought we could do without that. That's different from considering it "right" and "good". I changed the None-checking behaviour in Pyrex because I *wanted* to break

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Robert Bradshaw
On Mon, May 7, 2012 at 8:48 AM, Dag Sverre Seljebotn wrote: > On 05/07/2012 03:04 PM, Stefan Behnel wrote: >> >> Dag Sverre Seljebotn, 07.05.2012 13:48: >> >>> Here you go: >>> >>> def foo(np.ndarray[double] a, np.ndarray[double] out=None): >>>     if out is None: >>>         out = np.empty_like(a

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Robert Bradshaw
On Mon, May 7, 2012 at 3:40 AM, Dag Sverre Seljebotn wrote: > [moving to dev list] > > > On 05/07/2012 11:17 AM, Stefan Behnel wrote: >> >> Dag Sverre Seljebotn, 07.05.2012 10:44: >>> >>> On 05/07/2012 07:48 AM, Stefan Behnel wrote: shaunc, 07.05.2012 07:13: > > The following cod

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread mark florisson
On 7 May 2012 18:06, Stefan Behnel wrote: > mark florisson, 07.05.2012 18:18: >> On 7 May 2012 17:16, mark florisson wrote: >>> On 7 May 2012 17:12, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 18:07: > On 05/07/2012 06:04 PM, mark florisson wrote: >> On 7 May 2012 12:10, Ste

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Stefan Behnel
mark florisson, 07.05.2012 18:18: > On 7 May 2012 17:16, mark florisson wrote: >> On 7 May 2012 17:12, Stefan Behnel wrote: >>> Dag Sverre Seljebotn, 07.05.2012 18:07: On 05/07/2012 06:04 PM, mark florisson wrote: > On 7 May 2012 12:10, Stefan Behnel wrote: >> BTW, is there a reason wh

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Dag Sverre Seljebotn
On 05/07/2012 06:18 PM, mark florisson wrote: On 7 May 2012 17:16, mark florisson wrote: On 7 May 2012 17:12, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 18:07: On 05/07/2012 06:04 PM, mark florisson wrote: On 7 May 2012 12:10, Stefan Behnel wrote: BTW, is there a reason why we s

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread mark florisson
On 7 May 2012 17:16, mark florisson wrote: > On 7 May 2012 17:12, Stefan Behnel wrote: >> Dag Sverre Seljebotn, 07.05.2012 18:07: >>> On 05/07/2012 06:04 PM, mark florisson wrote: On 7 May 2012 12:10, Stefan Behnel wrote: > BTW, is there a reason why we shouldn't allow a "not None" decla

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread mark florisson
On 7 May 2012 17:12, Stefan Behnel wrote: > Dag Sverre Seljebotn, 07.05.2012 18:07: >> On 05/07/2012 06:04 PM, mark florisson wrote: >>> On 7 May 2012 12:10, Stefan Behnel wrote: BTW, is there a reason why we shouldn't allow a "not None" declaration for cdef functions? Obviously, the cal

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread mark florisson
On 7 May 2012 16:48, Dag Sverre Seljebotn wrote: > On 05/07/2012 03:04 PM, Stefan Behnel wrote: >> >> Dag Sverre Seljebotn, 07.05.2012 13:48: >> >>> Here you go: >>> >>> def foo(np.ndarray[double] a, np.ndarray[double] out=None): >>>     if out is None: >>>         out = np.empty_like(a) >> >> >>

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Stefan Behnel
Dag Sverre Seljebotn, 07.05.2012 18:07: > On 05/07/2012 06:04 PM, mark florisson wrote: >> On 7 May 2012 12:10, Stefan Behnel wrote: >>> BTW, is there a reason why we shouldn't allow a "not None" declaration for >>> cdef functions? Obviously, the caller would have to do the check in that >>> case.

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Dag Sverre Seljebotn
On 05/07/2012 06:04 PM, mark florisson wrote: On 7 May 2012 12:10, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 12:40: moving to dev list Makes sense. On 05/07/2012 11:17 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 10:44: On 05/07/2012 07:48 AM, Stefan Behnel wrote

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread mark florisson
On 7 May 2012 12:10, Stefan Behnel wrote: > Dag Sverre Seljebotn, 07.05.2012 12:40: >> moving to dev list > > Makes sense. > >> On 05/07/2012 11:17 AM, Stefan Behnel wrote: >>> Dag Sverre Seljebotn, 07.05.2012 10:44: On 05/07/2012 07:48 AM, Stefan Behnel wrote: > I wonder why a memory vie

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread mark florisson
On 7 May 2012 12:51, Dag Sverre Seljebotn wrote: > On 05/07/2012 01:48 PM, Dag Sverre Seljebotn wrote: >> >> On 05/07/2012 01:10 PM, Stefan Behnel wrote: >>> >>> Dag Sverre Seljebotn, 07.05.2012 12:40: moving to dev list >>> >>> >>> Makes sense. >>> On 05/07/2012 11:17 AM, Stefan Be

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Dag Sverre Seljebotn
On 05/07/2012 03:04 PM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 13:48: Here you go: def foo(np.ndarray[double] a, np.ndarray[double] out=None): if out is None: out = np.empty_like(a) Ah, right - output arguments. Hadn't thought of those. Still, since you pass None

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Stefan Behnel
Dag Sverre Seljebotn, 07.05.2012 13:48: > On 05/07/2012 01:10 PM, Stefan Behnel wrote: >> Dag Sverre Seljebotn, 07.05.2012 12:40: >>> On 05/07/2012 11:17 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 10:44: > On 05/07/2012 07:48 AM, Stefan Behnel wrote: >> I wonder why a me

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Dag Sverre Seljebotn
On 05/07/2012 01:48 PM, Dag Sverre Seljebotn wrote: On 05/07/2012 01:10 PM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 12:40: moving to dev list Makes sense. On 05/07/2012 11:17 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 10:44: On 05/07/2012 07:48 AM, Stefan Behn

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Dag Sverre Seljebotn
On 05/07/2012 01:10 PM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 12:40: moving to dev list Makes sense. On 05/07/2012 11:17 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 10:44: On 05/07/2012 07:48 AM, Stefan Behnel wrote: I wonder why a memory view should be allow

Re: [Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Stefan Behnel
Dag Sverre Seljebotn, 07.05.2012 12:40: > moving to dev list Makes sense. > On 05/07/2012 11:17 AM, Stefan Behnel wrote: >> Dag Sverre Seljebotn, 07.05.2012 10:44: >>> On 05/07/2012 07:48 AM, Stefan Behnel wrote: I wonder why a memory view should be allowed to be None in the first place

[Cython] Fwd: Re: [cython-users] checking for "None" in nogil function

2012-05-07 Thread Dag Sverre Seljebotn
[moving to dev list] On 05/07/2012 11:17 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 07.05.2012 10:44: On 05/07/2012 07:48 AM, Stefan Behnel wrote: shaunc, 07.05.2012 07:13: The following code: cdef int foo( double[:] bar ) nogil: return bar is None causes: "Converting to Python ob