On this page
inspect.FullArgSpec
Prev: inspect.FrameInfo | Up: inspect | Next: inspect.get_annotations
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org โ inspect.FullArgSpec
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import FullArgSpec
Signature & Overview
inspect.FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
Methods & Attributes
FullArgSpec.count(self, value, /)โ Return number of occurrences of value.FullArgSpec.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import inspect
def fn(a: int, /, b: int = 1, *, c: int = 2) -> int:
return a + b + c
spec = inspect.getfullargspec(fn)
assert isinstance(spec, inspect.FullArgSpec) and spec.kwonlyargs == ["c"]
Gotchas
- Prefer
inspect.signature():FullArgSpeccannot distinguish positional-only (/) parameters from regular positional parameters cleanly.
REPL Inspect
from inspect import FullArgSpec
help(FullArgSpec)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/FrameInfo Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/get_annotations 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