On this page
inspect.getargvalues
Prev: inspect.getargs | Up: inspect | Next: inspect.getasyncgenlocals
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getargvalues
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import getargvalues
Signature & Overview
inspect.getargvalues(frame)
Get information about arguments passed into a particular frame.
Usage
import inspect
def fn(x, y=5):
av = inspect.getargvalues(inspect.currentframe())
return (av.args, av.locals["x"], av.locals["y"])
assert fn(1) == (["x", "y"], 1, 5)
Gotchas
- Operates on a live stack frame: Useful inside debuggers or exception loggers.
REPL Inspect
from inspect import getargvalues
help(getargvalues)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/getargs Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/getasyncgenlocals 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