On this page
numpy.issubclass_
numpy.issubclass_(arg1, arg2)[source]-
Determine if a class is a subclass of a second class.
issubclass_is equivalent to the Python built-inissubclass, except that it returns False instead of raising a TypeError if one of the arguments is not a class.- Parameters
-
arg1class-
Input class. True is returned if
arg1is a subclass ofarg2. arg2class or tuple of classes.-
Input class. If a tuple of classes, True is returned if
arg1is a subclass of any of the tuple elements.
- Returns
-
outbool-
Whether
arg1is a subclass ofarg2or not.
See also
issubsctype, issubdtype,issctype
Examples
>>> np.issubclass_(np.int32, int) False >>> np.issubclass_(np.int32, float) False >>> np.issubclass_(np.float64, float) True
© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.20/reference/generated/numpy.issubclass_.html