Function Details: issubclass

Description


Returns whether 'class' is a derived from another class or is the same class.


Extended Description


The issubclass() function checks if the first argument is a subclass of the second argument. If the second argument is a tuple of classes, it checks if the first argument is a subclass of any of those classes. A class is considered a subclass of itself.


Read More about issubclass from Python Documentation

Function Signature


issubclass(class: type, classinfo: Union[type, Tuple[type, ...]]) -> bool

Module: builtins

Parameters



Parameter List


  • class: type
  • classinfo: Union[type, Tuple[type, ...]]

Return


Returns a boolean indicating whether the first argument is a subclass of the second argument (or any class in the tuple of the second argument).


Return Type


bool

Output

Explanation

This example demonstrates basic usage of issubclass() with a simple inheritance hierarchy.