Re: [Numpy-discussion] Subclassing numarray arrays
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Thu, 2003-09-25 at 12:28, Paul Dubois wrote:
I think there is a need to effectively subclass numarray where the parameter lists don't change. Doing a Matrix subclass sounds reasonable to me and we should explore the OOP necessary to make it convenient. STSCI hasn't asked for it, but a couple different numarray contributors have.
radd does not work for numarray + MA. Instead, the expression is resolved as numarray.__add__(MA). Were MA a numarray subclass, it would work, given the facilities provided by Python alone. The defers-to-me-stuff is a simple work around to avoid having to reverse engineer this one Numeric behavior.
This reasoning led me to believe that subclassing had virtually no value and to the design of MA that has-a numeric array rather than is-a.
Since we want to port MA as-is to numarray, we're not changing that.
Is there some big breakthrough here I missed?
No, but there are two issues: (1) effectively supporting subclasses (2) effectively supporting interoperability with other classes. (1) needs more discussion. (2) is already solved. -- Todd Miller jmiller@stsci.edu STSCI / ESS / SSB
participants (1)
-
Todd Miller