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

Charles R Harris charlesr.harris@gmail....
Wed Mar 19 11:56:27 CDT 2008

On Wed, Mar 19, 2008 at 10:42 AM, Travis E. Oliphant <oliphant@enthought.com>

> Neal Becker wrote:
> > In arrayobject.c, various complex functions (e.g., array_imag_get) use:
> > 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.

That brings up a question I have. In looking to introduce float16, I noted
that the typenumbers are tightly packed at the low end. There is space for
user defined types >=128, IIRC, but float16 and cfloat16 really belongs down
with the numbers. There are also several other types in the IEEE pipeline.
So I am wondering if we can't spread the type numbers out a bit more.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080319/41d6551d/attachment.html 

More information about the Numpy-discussion mailing list