Re: [Numpy-discussion] Poll: Semantics for % in Cython

2010-05-04 Thread S. Chris Colbert
On Thu, 2009-03-12 at 19:59 +0100, Dag Sverre Seljebotn wrote: (First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users follow the Cython list?) In Python, if I write -1 % 5, I get 4. However, in

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2010-05-04 Thread Chris Colbert
On Tue, May 4, 2010 at 12:20 PM, S. Chris Colbert sccolb...@gmail.comwrote: On Thu, 2009-03-12 at 19:59 +0100, Dag Sverre Seljebotn wrote: (First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Dag Sverre Seljebotn
Robert Kern wrote: On Thu, Mar 12, 2009 at 17:45, Sturla Molden stu...@molden.no wrote: 2009/3/13 Charles R Harris charlesr.har...@gmail.com: That said, I think it best to leave '%' with its C default and add a special modulus function for the python version. Changing its meaning in C-like

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn da...@student.matnat.uio.no wrote: Robert Kern wrote: That may be part of the confusion. The expression -1%5 has no variables. Perhaps Dag can clarify what he is asking about:   # Constants?  (No one uses just constants in expressions,   #

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Fernando Perez
On Thu, Mar 12, 2009 at 11:34 PM, Robert Kern robert.k...@gmail.com wrote: One possibility (that may be opening a can of worms) is to have two sets of operators, one that does native semantics (C for cdef longs, Python for Python ints) and one that does Python semantics even on cdef longs. I

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Dag Sverre Seljebotn
Fernando Perez wrote: On Thu, Mar 12, 2009 at 11:34 PM, Robert Kern robert.k...@gmail.com wrote: One possibility (that may be opening a can of worms) is to have two sets of operators, one that does native semantics (C for cdef longs, Python for Python ints) and one that does Python

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Sturla Molden
On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn   # Explicitly declared C types?   cdef long i, j, k   i = -1   j = 5   k = i % j This one is what I'm really asking about. My opinion on this is that C semantics have been explicitly requested, so they should be used. I agree with

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Dag Sverre Seljebotn
Sturla Molden wrote: On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn # Explicitly declared C types? cdef long i, j, k i = -1 j = 5 k = i % j This one is what I'm really asking about. My opinion on this is that C semantics have been explicitly

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Sturla Molden
On 3/13/2009 12:47 PM, Dag Sverre Seljebotn wrote: (Introducing a new set of types for typed Python is an idea that could please everybody, but I fear the confusion it would bring myself...) AFAIK, Python 3 has optional type annotations. Sturla Molden

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-13 Thread Christopher Barker
Robert Kern wrote: # Explicitly declared C types? cdef long i, j, k i = -1 j = 5 k = i % j This one is what I'm really asking about. My opinion on this is that C semantics have been explicitly requested, so they should be used. maybe ... One possibility (that may be opening

[Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Dag Sverre Seljebotn
(First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users follow the Cython list?) In Python, if I write -1 % 5, I get 4. However, in C if I write -1 % 5 I get -1. The question is, what should I get in

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Gael Varoquaux
On Thu, Mar 12, 2009 at 07:59:48PM +0100, Dag Sverre Seljebotn wrote: (First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users follow the Cython list?) Yes, IMHO. In Python, if I write -1 % 5, I

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Stéfan van der Walt
Hi Dag 2009/3/12 Dag Sverre Seljebotn da...@student.matnat.uio.no: (First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users follow the Cython list?) Given that many of the subscribers make use of the

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Charles R Harris
On Thu, Mar 12, 2009 at 12:59 PM, Dag Sverre Seljebotn da...@student.matnat.uio.no wrote: (First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users follow the Cython list?) In Python, if I write -1

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Stéfan van der Walt
2009/3/13 Charles R Harris charlesr.har...@gmail.com: That said, I think it best to leave '%' with its C default and add a special modulus function for the python version. Changing its meaning in C-like code is going to confuse things. This is Cython code, so I think there is an argument to be

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Sturla Molden
2009/3/13 Charles R Harris charlesr.har...@gmail.com: That said, I think it best to leave '%' with its C default and add a special modulus function for the python version. Changing its meaning in C-like code is going to confuse things. This is Cython code, so I think there is an

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Robert Kern
On Thu, Mar 12, 2009 at 17:45, Sturla Molden stu...@molden.no wrote: 2009/3/13 Charles R Harris charlesr.har...@gmail.com: That said, I think it best to leave '%' with its C default and add a special modulus function for the python version. Changing its meaning in C-like code is going to