issubclass
issubclass is a built-in Python function that determines whether one class is a subclass of another. It is used to query the inheritance hierarchy at runtime and can reflect direct and indirect inheritance, including cases involving multiple inheritance and virtual subclassing via abstract base classes.
The signature is issubclass(cls, class_or_tuple). The first argument, cls, must be a class object. The second argument,
Both arguments must be class objects; passing a non-class value for either argument raises a TypeError. The
In practice, issubclass is often used to guard behavior that depends on type hierarchy, in contrast to