[Numpy-discussion] numpy.array and subok kwarg

Scott Sinclair scott.sinclair.za at gmail.com
Fri Jan 23 00:44:11 EST 2009


> 2009/1/22 Pierre GM <pgmdevlist at gmail.com>:
> 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?
>
> Blame the doc: the default for subok in array is False, as explicit in
> the _array_fromobject Cfunction (in multiarray). So no, you're not
> doing anything wrong. Note that by default subok=True for
> numpy.ma.array.

Corrected in the doc-editor.

Cheers,
Scott



More information about the NumPy-Discussion mailing list