On Mar 16, 2009, at 4:15 PM, Greg Ewing wrote: > Sturla Molden wrote: > >> As I see it, >> >> cdef int a, b, c >> >> is a request to "step into C" when using these variables. > > How about this: > > 1) By default, all operators have C semantics when > applied to C data types. > > 2) To get Python semantics for / and %, put this at > the top of the module: > > from __python__ import idiv, imod > > 3) You are allowed to feed a ".py" file directly to > Cython, in which case it is compiled as though it > begins with an implicit > > from __python__ import * > > This mechanism could be extended to handle any other > areas where there is conflicting desire for C and > Python compatibility.
Interestingly enough, this was almost exactly my original proposal too from a week ago (the only difference being from __python__ import ..." being much cleaner than a compiler flag, and I agree an in-file directive is better). - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
