On this page
inspect.getouterframes
Prev: inspect.getmro | Up: inspect | Next: inspect.Parameter
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getouterframes
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import getouterframes
Signature & Overview
inspect.getouterframes(frame, context=1)
Get a list of records for a frame and all higher (calling) frames.
Usage
import inspect
def inner():
return inspect.getouterframes(inspect.currentframe())
frames = inner()
assert frames[0].function == "inner"
Gotchas
- Index 0 is the current frame; higher indices walk up toward the caller: Delete frame lists promptly to avoid reference cycles.
REPL Inspect
from inspect import getouterframes
help(getouterframes)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/getmro Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Parameter Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/inspect/ArgInfo Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Arguments Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Attribute Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BlockFinder Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BoundArguments shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BufferFlags shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/ClassFoundException shared tags: #inspect, #stdlib