Skip to content
Built-in Functions

issubclass()

Check whether one class inherits from another.

issubclass(class, classinfo)

issubclass() works with classes, not ordinary object values. It returns true when the first class is the same as or inherits from the second class.

Parameters

NameDescription
classThe class to test.
classinfoA class or tuple of classes to compare against.

Returns

True if the class inherits from or matches classinfo; otherwise False.

Try it

Run it and change it
class Dog:
    pass
print(issubclass(Dog, object))

Related entries