Search code examples
pythoninheritancestaticisinstance

In python, is there a static equivalent to isinstance?


I want to scan a module (using dir()) and extract all class names (type objects) of classes that extend a certain parent class. Is there any way to do this without first creating instances that I can check with isinstance()?


Solution

  • I think you might be looking for issubclass