Last active
September 22, 2022 18:36
-
-
Save leonjza/9a1dd476806589dd7ff3 to your computer and use it in GitHub Desktop.
Lame Python Object Dumper
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 dump(obj, name = None): | |
for attr in dir(obj): | |
if hasattr(obj, attr): | |
print(" * %s.%s = %s" % ('obj' if name is None else name, attr, getattr(obj, attr))) | |
def noValDump(obj, name = None): | |
for attr in dir(obj): | |
if hasattr(obj, attr): | |
print(" * %s.%s" % ('obj' if name is None else name, attr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment