Last active
August 17, 2022 13:04
Examine a python object
This file contains hidden or 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 examine(obj): | |
objl = dir(obj) | |
for item in objl: | |
print("%s: %s"%(item.ljust(40," "), type(getattr(obj, item)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Examines an object by iterating through all its attributes , printing them and printing their type.
Useful for printf-style debugging/analysis