issubclass()

Built-in FunctionPython 2.0+Intermediate

Returns True if a class is a subclass of another class

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
print(issubclass(bool, int))
print(issubclass(int, object))
print(issubclass(str, (int, str)))

issubclass() is a built-in function that returns true if a class is a subclass of another class.

Try in Playground

Tags

builtinfunctioncoreooptype-checkinginheritance

Related Items