On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn firstname.lastname@example.org 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 consistency with the other choices will # affect this.) -1 % 5
# 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.
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 to decide which one gets blessed with "%" and which has to use the alternate ("~%"? there's a whole PEP sitting around which goes over various options).