[Numpy-discussion] PyObject typecodes are gone in numarray?
perry at stsci.edu
Thu Mar 20 06:27:08 CST 2003
> At the moment, numarray doesn't support PyObject arrays (though
> I believe that adding such capability is simple enough I am
> tempted to try to do so today!).
> Another possibility is to use chararray *if* you are dealing with
> fixed length strings. We use that as a way of providing character
> fields to our record array class (recarray). If this is so, you may
> find that more useful. Let us know and we will point you to where
> you can find more information (recarray and chararray aren't that
> well documented right now).
Having looked at it in more detail, it is more involved that I
had hoped so it won't be done in an afternoon, but it doesn't
look difficult. I think we will have to wait until we finish our
current round of optimization work before adding this capability.
While the PyObject type can use much of NDArray, it does require
some new machinery to handle safety issues regarding Python objects
(ensuring that the buffer used for such arrays always contain valid
PyObject entries and nothing but, plus handling inref'ing and decref'ing
all entries in arrays as appropriate).
More information about the Numpy-discussion