[Numpy-discussion] Re: ndarray.fill and ma.array.filled

Sasha ndarray at mac.com
Fri Apr 7 17:56:24 CDT 2006


On 4/7/06, Tim Hochberg <tim.hochberg at cox.net> wrote:
> [...]
> Perhaps MaskedArray should inherit from ndarray for the time being. Many
> of the methods would need to reimplemented anyway, but it would make
> asanyarray work. Someone was just complaining about asarray munging his
> arrays. That's correct behaviour, but it would be nice if asanyarray did
> the right thing. I suppose we could just special case asanyarray to
> ignore MaskedArrays, that might be better since it's less constraining
> from an implementation side too.
>
Just for the record.  Currently MA does not inherit from ndarray. 
There are some benefits to be gained from changing MA design from
containment to inheritance, by I am very sceptical about the use of
inheritance in the array setting.


> >
> This may be an oportune time to propose something that's been cooking in
> the back of my head for a week or so now: A stripped down array
> superclass.

This is a very worthwhile idea and I hate to see it burried in a
non-descriptive thread.  I've copied your proposal to the wiki at
<http://projects.scipy.org/scipy/numpy/wiki/ArraySuperClass>.




More information about the Numpy-discussion mailing list