pytools.typing.issubclass_generic#

pytools.typing.issubclass_generic(subclass, base)[source]#

Check if a class is a subclass of a generic instance, i.e., it is a subclass of the generic class, and has compatible type arguments.

Parameters
  • subclass (Any) – the (potentially generic) subclass to check

  • base (Any) – the (potentially generic) base class to check against

Return type

bool

Returns

True if the class is a subclass of the generic instance, False otherwise