Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
hell debugger
import inspect
depth = 0
def props(obj):
global depth
depth += 1
pr = {}
for name in dir(obj):
value = getattr(obj, name)
if not name.startswith('__') and not inspect.ismethod(value):
pr[name] = value
if value.__repr__().startswith('<') and depth < 5:
pr[name] = props(value)
except Exception as err:
depth -= 1
return pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment