Last active
December 17, 2015 22:39
-
-
Save jgillis/5683620 to your computer and use it in GitHub Desktop.
Method to print the class inheritance hierarchy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_subclasses(myclass, depth=0): | |
print (" " * depth) + " - " + myclass.__name__ | |
for s in myclass.__subclasses__(): | |
print_subclasses(s,depth=depth+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
returns