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

inspect.getcallargs

Prev: inspect.getblock | Up: inspect | Next: inspect.getclasstree
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getcallargs
Tags: #public #python3 #stdlib #inspect


Import

import inspect
from inspect import getcallargs

Signature & Overview

inspect.getcallargs(func, /, *positional, **named)

Get the mapping of arguments to values.

Usage

import inspect

def fn(a, b=2): pass
assert inspect.getcallargs(fn, 1) == {"a": 1, "b": 2}

Gotchas

REPL Inspect

from inspect import getcallargs
help(getcallargs)

Linked from

Related notes