inspect.getfullargspec()

inspect.getfullargspec(func)

Get the names and default values of a Python function’s arguments. A named tuple is returned:

FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)

args is a list of the argument names. varargs and varkw are the names of the * and ** arguments or None. defaults is an n-tuple of the default values of the last n arguments, or None if there are no default arguments. kwonlyargs is a list of keyword-only argument names. kwonlydefaults is a dictionary mapping names from kwonlyargs to defaults. annotations is a dictionary mapping argument names to annotations.

The first four items in the tuple correspond to getargspec().

Changed in version 3.4: This function is now based on signature(), but still ignores __wrapped__ attributes and includes the already bound first parameter in the signature output for bound methods.

Deprecated since version 3.5: Use signature() and Signature Object, which provide a better introspecting API for callables.

doc_python
2016-10-07 17:35:00
Comments
Leave a Comment

Please login to continue.