Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Introspection With Python

DZone's Guide to

Introspection With Python

·
Free Resource

import inspect

def info():
    loc = inspect.currentframe(1).f_locals # its locals
    glob = inspect.currentframe(1).f_globals # its globals
    fct = inspect.currentframe(1).f_code.co_name #calling function
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}