Python issubclass()

The issubclass() function checks if the class argument (first argument) is a subclass of classinfo class (second argument).

issubclass() returns:

  • True if class is subclass of a class, or any element of the tuple
  • False otherwise
[mai mult...]

Python isinstance()

The isinstance() function checks if the object (first argument) is an instance or subclass of classinfo class (second argument).

isinstance() returns:

  • True if the object is an instance or subclass of a class or any element of the tuple
  • False otherwise

If classinfo is not a type or tuple of types, a TypeError exception is raised.

[mai mult...]