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

inspect.getargs

Prev: inspect.getabsfile | Up: inspect | Next: inspect.getargvalues
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getargs
Tags: #public #python3 #stdlib #inspect


Import

import inspect
from inspect import getargs

Signature & Overview

inspect.getargs(co)

Get information about the arguments accepted by a code object.

Usage

import inspect

def fn(a, b, *rest, **kw): pass
args = inspect.getargs(fn.__code__)
assert args.args == ["a", "b"] and args.varargs == "rest" and args.varkw == "kw"

Gotchas

REPL Inspect

from inspect import getargs
help(getargs)

Linked from

Related notes