[Cython] Fused types don't work with cdef classes?

Stefan Behnel stefan_ml at behnel.de
Wed Feb 13 09:30:22 CET 2013


Dave Hirschfeld, 13.02.2013 09:16:
> Robert Bradshaw writes:
>> Yes, this is a bug; there is a bad interaction between fused types and
>> special methods.
>>
>> I created http://trac.cython.org/cython_trac/ticket/802
>>
> 
> Thanks for following up. My actual use-case was to allow either 1D or 2D
> MemoryView inputs to a function by simply transforming the 1D MemoryView
> to a column vector.
> 
> For now the workaround is to simply disallow 1D inputs, but it would be nice to 
> have it working.

Depending on what the rest of your code looks like, a work-around might be
to move the code from __init__() to a separate cdef function and just call
that.

Stefan



More information about the cython-devel mailing list