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.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}