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

inspect.getfullargspec

Prev: inspect.getframeinfo | Up: inspect | Next: inspect.getgeneratorlocals
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getfullargspec
Tags: #public #python3 #stdlib #inspect


Import

import inspect
from inspect import getfullargspec

Signature & Overview

inspect.getfullargspec(func)

Get the names and default values of a callable object's parameters.

Usage

import inspect

def fn(a, b=1, *args, kw=2, **kwargs): pass
spec = inspect.getfullargspec(fn)
assert spec.args == ["a", "b"] and spec.kwonlydefaults == {"kw": 2}

Gotchas

REPL Inspect

from inspect import getfullargspec
help(getfullargspec)

Linked from

Related notes