[Numpy-discussion] Poll: Semantics for % in Cython
Thu Mar 12 17:45:02 CDT 2009
> 2009/3/13 Charles R Harris <firstname.lastname@example.org>:
>> That said, I think it best to leave '%' with its C default and add a
>> modulus function for the python version. Changing its meaning in C-like
>> is going to confuse things.
> This is Cython code, so I think there is an argument to be made that
> it is Python-like!
I'll just repeat what I've already said on the Cython mailing list:
I think C types should behave like C types and Python objects like Python
objects. If a C long suddenly starts to return double when divided by
another C long, then that will be a major source of confusion on my part.
If I want the behaviour of Python integers, Cython lets me use Python
objects. I don't declare a variable cdef long if I want it to behave like
a Python int.
More information about the Numpy-discussion