[Cython] Fused Types

Greg Ewing greg.ewing at canterbury.ac.nz
Tue May 3 07:47:58 CEST 2011


I'm a bit confused about how fused types combine to
create further fused types. If you have something
like

   ctypedef struct Vector:
     floating x
     floating y
     floating z

then is it going to generate code for all possible
combinations of types for x, y and z?

That's probably not what the user intended -- it's
more likely that he wants *two* versions of type
Vector, one with all floats and one with all doubles.
But without explicit type parameters, there's no way
to express that.

I worry that you're introducing a parameterised type
system in a half-baked way here without properly
thinking through all the implications.

-- 
Greg



More information about the cython-devel mailing list