On this page
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
- Prefer
inspect.signature()for new code:getfullargspec()is kept mainly for backwards compatibility.
REPL Inspect
from inspect import getfullargspec
help(getfullargspec)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/getframeinfo Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/getgeneratorlocals 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