I just added http://trac.cython.org/cython_trac/ticket/441

Basically,

ctypedef float myfloat;
...
print some_myfloat * some_complex

miscompiles as "some_myfloat" is coerced to "myfloat complex" (which, 
interestingly, is a type which can't be created or used in any other way!)

Fixing this requires some thought.

This probably broke because (in order to fix another bug) I stepped away 
from "the order something is needed in Cython decides output order in 
C". I believe that was a correct decision and don't want to step back. 
The proper solution is a DAG of all types and their dependencies. I 
believe that is a bit heavy/destabilizing for 0.12 though. Perhaps 
output all very simply typedefs (typedefs of ints and floats) first, 
then complex, then the rest?

However there's another issue: Unlike what I originally thought, it is 
then possible to do e.g.

cdef extern from "foo.h":
    ctypdef double mydouble # is size correct?

print (some_mydouble * some_complex).imag

This can fail spectacularily as we currently rely on determining 
__Pyx_c_prod vs. __Pyx_c_prodf and so on at Cythonization time. 
Lisandro, did you mention efforts in this direction?

Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to