Hi Travis and team, I am just writing some docs for subclassing, and ran into some behavior I didn't understand:
In [143]: class A(np.ndarray): pass In [144]: arr = np.arange(5) In [145]: obj = arr.copy().view(A) In [146]: type(obj) Out[146]: <class '__main__.A'> In [147]: obj.__array_priority__ # shouldn't this be 1.0 by default (from the numpy book)? Out[147]: 0.0 In [148]: type(np.multiply(arr, obj)) # this is what I expected Out[148]: <class '__main__.A'> In [149]: type(np.multiply.outer(arr, obj)) # this is not - I expected class A again Out[149]: <type 'numpy.ndarray'> In [151]: class A(np.ndarray): __array_priority__ = 20.0 # setting array priority does not affect behavior In [152]: obj = arr.copy().view(A) In [153]: type(np.multiply.outer(arr, obj)) Out[153]: <type 'numpy.ndarray'> Is this what you would expect? Thanks for clarification, and apologies if I misunderstood... Matthew _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
