> [ ] Get 4, because it should behave just like in Python, even though > it will require extra logic and be a bit slower > > [X] Get -1, because they're C ints, and besides we wouldn't be using > Cython if we didn't care about performance > > [ ] Let the programmer decide (e.g. using http://wiki.cython.org/ > enhancements/compilerdirectives ) recognizing that % will mean > different things in different contexts. >
I've also been reading the Cython thread ... I agree that there's a good argument for Python semantics, but when it comes down to it, I think of Cython as "being able to move my inner loops down to C" -- if I type "cdef int x", I'm generally expecting x to act like a C int, and be *as fast as humanly possible*. Plus, when we move things from Python down to Cython, we already have changes to make -- for instance, x**2 has to change, because C doesn't support exponentiation, so why would it be any different for %? That said, it would be really nice if there were an easy way to get Python semantics for % on C ints. I just don't think it should be the default. -cc --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---