[Numpy-discussion] Can't add user defined complex types

Travis E. Oliphant oliphant at enthought.com
Wed Mar 19 12:42:00 EDT 2008


Neal Becker wrote:
> In arrayobject.c, various complex functions (e.g., array_imag_get) use:
> PyArray_ISCOMPLEX -> PyTypeNum_ISCOMPLEX, 
> which is hard coded to 2 predefined types :(
>
> If PyArray_ISCOMPLEX allowed user-defined types, I'm guessing functions such
> as array_imag_get would just work?
>   
I don't think that it true.   There would need to be some kind of idea 
of "complex-ness" that is tested.   One way this could work is if your 
corresponding scalar inherited from the generic complex scalar type and 
then that was tested for.  

-Travis O.





More information about the NumPy-Discussion mailing list