robertwb / issues-import-test

0 stars 0 forks source link

Always type-infer floating point types #614

Closed robertwb closed 14 years ago

robertwb commented 15 years ago

Depends on http://cython.trac.org/ticket/236.

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.

Migrated from http://trac.cython.org/ticket/460

robertwb commented 14 years ago

scoder changed owner from somebody to scoder This is implemented as part of the safe type inference mode.

robertwb commented 14 years ago

scoder changed resolution to fixed status from new to closed