On this page
  1. inspect.getargvalues
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from inspect import getargvalues
help(getargvalues)

Linked from

Related notes