[Numpy-discussion] subclassing RecordArrays
Les Schaffer
schaffer at optonline.net
Sat Jul 2 19:40:22 CDT 2005
Is there a simple way to subclass RecordArrays?
it seems not.
suppose i want to have a class RecArrayD(RecArray) that returns a list
of its fields, much like a Dict does: recarrayD.keys()
the problem is that the fromXXX functions in records.py know only about
the one RecArray. and RecArrayD._copyFrom() seems to be of little help,
since the new style RecArray has to be framed out first, so to speak.
which leaves me to write a new fromRecArray() function that uses the new
class.
all to get a list of the fields.
is this by design, or am i missing something?
yes, i can get the keys like so: recarray._names, but i assume that the
'_' in front of '_names' is there for a reason, like maybe don't count
on it???
or would the designers be willing to add a keys()-like method in for the
next release?
les schaffer
More information about the Numpy-discussion
mailing list