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 wrote: > 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 Cy

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. Howeve

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 (

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 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

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

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 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

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 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 leave it to you

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

2009-03-12 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn 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, >>   # really, but co

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

2009-03-12 Thread Dag Sverre Seljebotn
Robert Kern wrote: > On Thu, Mar 12, 2009 at 17:45, Sturla Molden wrote: >> >> >> >>> 2009/3/13 Charles R Harris : 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 g

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

2009-03-12 Thread Robert Kern
On Thu, Mar 12, 2009 at 17:45, Sturla Molden wrote: > > > > >> 2009/3/13 Charles R Harris : >>> 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. >> >

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

2009-03-12 Thread Sturla Molden
> 2009/3/13 Charles R Harris : >> 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 made

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

2009-03-12 Thread Stéfan van der Walt
2009/3/13 Charles R Harris : > 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 made that it is Python

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 wri

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 : > (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 NumPy support in Cython,

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"

[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