Since Python uses double for its float and complex types and all important operations on it can map directly to C space, and since Python<->C conversions are 1:1, we can safely turn on type-inference in this case without breaking anything.
This requires that http://cython.trac.org/ticket/236 is implemented first though so that any use of attributes or methods goes through.
'''Note''' that, at least if typeinference is turned off, this means that
cdef float x = 3.2
y = x # y will be typed as double,
# so as to behave as if y was a Python
# object
Unresolved issue: If typeinference is turned on, perhaps y should be typed as float instead.
Depends on http://cython.trac.org/ticket/236.
Since Python uses
double
for itsfloat
andcomplex
types and all important operations on it can map directly to C space, and since Python<->C conversions are 1:1, we can safely turn on type-inference in this case without breaking anything.This requires that http://cython.trac.org/ticket/236 is implemented first though so that any use of attributes or methods goes through.
'''Note''' that, at least if
typeinference
is turned off, this means thatUnresolved issue: If
typeinference
is turned on, perhapsy
should be typed as float instead.Migrated from http://trac.cython.org/ticket/460