[Cython] Semantics of cdef int division and %?
Stefan Behnel
stefan_ml at behnel.de
Thu Mar 12 07:20:31 CET 2009
Robert Bradshaw wrote:
> I think this is neither the first nor last issue that will come up
> like this. What I think we should do is have a "-pedantic" flag which
> obeys Python semantics exactly, at the expense of speed. This applies
> to %, //, **, etc. (Overflowing is a separate issue, and I think
> there should be a flag for that too.) Compilation of .py files would
> be, by default, with -pedantic enabled, and compilation of .pyx files
> with it disabled.
Wouldn't it be better to have such a flag emit warnings (preferably with a
hint how to write better code) instead of changing the semantics of operators?
I think having operators change their semantics without a clear change in
the user code (such as a __future__ import) is a rather dangerous 'feature'.
Stefan
More information about the Cython-dev
mailing list