Re: [Numpy-discussion] numpy.array and subok kwarg

2009-01-22 Thread Scott Sinclair
> 2009/1/22 Pierre GM : > Darren, > > >> The type returned by np.array is ndarray, unless I specifically set >> subok=True, in which case I get a MyArray. The default value of >> subok is True, so I dont understand why I have to specify subok >> unless I want it to be False. Is my subclass missing

Re: [Numpy-discussion] numpy.array and subok kwarg

2009-01-22 Thread Pierre GM
Darren, > The type returned by np.array is ndarray, unless I specifically set > subok=True, in which case I get a MyArray. The default value of > subok is True, so I dont understand why I have to specify subok > unless I want it to be False. Is my subclass missing something > important?

[Numpy-discussion] numpy.array and subok kwarg

2009-01-22 Thread Darren Dale
Hello, I have a test script: import numpy as np class MyArray(np.ndarray): __array_priority__ = 20 def __new__(cls): return np.asarray(1).view(cls).copy() def __repr__(self): return 'my_array' __str__ = __repr__ def __mul__(self, other): return s