[Numpy-discussion] can't resize ndarray subclass

Travis Oliphant oliphant.travis at ieee.org
Tue Feb 28 14:20:00 CST 2006


Zachary Pincus wrote:

> Thanks Travis for the replies and the new functionality in the SVN!
>
> I think I have enough (well, maybe once I figure out  
> __array_priority__) to get a decent wiki entry for subclassing  
> ndarray, and maybe some template subclasses that others can use.
>
> I presume __array_priority__ determines the resulting type when two  
> different type arrays are ufunc'd together? The exact mechanism of  
> which object gets selected as the parent, etc., is still unclear though.

When two different subclasses appear in a ufunc (or in other places in 
ndarray), the subclass chosen for creation is the one with highest 
__array_priority__.

The "parent" concept is entirely separate is the object passed to 
__array_finalize__ and should be of the same type as self (or None).

-Travis






More information about the Numpy-discussion mailing list