Skip to content

Instantly share code, notes, and snippets.

@defparam
Last active August 17, 2022 13:04
Examine a python object
def examine(obj):
objl = dir(obj)
for item in objl:
print("%s: %s"%(item.ljust(40," "), type(getattr(obj, item))))
@defparam
Copy link
Author

Examines an object by iterating through all its attributes , printing them and printing their type.
Useful for printf-style debugging/analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment