Subclassing numarray's arrays

Mizrandir mizrandir at hotmail.com
Sat Aug 14 13:08:55 EDT 2004


I'd like to subclass numarray's array. I'd like to add some methods
and override others like __init__. I don't know how to do this and
haven't found help searching the manual or the web, can someone help?

For example imagine I just want to do something as simple as making a
subclass "NewClass" with the __init__ method overridden so that the
behaviour would be:

>>> a = NewClass(2)
>>> print a
[[2 2]
 [2 2]]

How could that be done?

Thanks in advance, miz.



More information about the Python-list mailing list