[Numpy-discussion] Detect subclass of ndarray

Anne Archibald peridot.faceted at gmail.com
Sat Mar 24 00:37:24 EDT 2007


On 23/03/07, Charles R Harris <charlesr.harris at gmail.com> wrote:
> Anyone,
>
> What is the easiest way to detect in python/C if an object is a subclass of
> ndarray?

Um, how about isinstance or issubclass? (if you want strictness you
can look at whether x.__class__ is zeros(1).__class__)

Anne



More information about the NumPy-Discussion mailing list