w3resource

NumPy Data type: issubclass_() function

numpy.issubclass_() function

The issubclass_() function is used to determine if a class is a subclass of a second class.

issubclass_ is equivalent to the Python built-in issubclass, except that it returns False instead of raising a TypeError if one of the arguments is not a class.

Version: 1.15.0

Syntax:

numpy.issubclass_(arg1, arg2)

Parameter:

Name Description Required /
Optional
arg1 : class Input class. True is returned if arg1 is a subclass of arg2. Required
arg2 : class or tuple of classes Input class. If a tuple of classes, True is returned if arg1 is a subclass of any of the tuple elements. Required

Return value:

out : bool - Whether arg1 is a subclass of arg2 or not.

Example: numpy.issubclass() function

>>> import numpy as np
>>> np.issubclass_(np.int32, int)
False
>>> np.issubclass_(np.int32, float)
False

Previous: issubsctype()
Next: find_common_type()



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/numpy/data-type-routines/issubclass.php