diff options
author | Georg Brandl <georg@python.org> | 2007-09-12 19:04:21 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-09-12 19:04:21 (GMT) |
commit | 138bcb569ea2a884acfa3c84bb64733ecea915e0 (patch) | |
tree | 3835a788a9ed9f68250d7d9512c53b1ef1066477 | |
parent | 546e2d66b6b82ebf644d8bd65310a53aa309c05a (diff) | |
download | cpython-138bcb569ea2a884acfa3c84bb64733ecea915e0.zip cpython-138bcb569ea2a884acfa3c84bb64733ecea915e0.tar.gz cpython-138bcb569ea2a884acfa3c84bb64733ecea915e0.tar.bz2 |
Document inspect.getfullargspec(). Fixes #1121.
-rw-r--r-- | Doc/library/inspect.rst | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 530f1bd..7adb716 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -376,10 +376,31 @@ Classes and functions Get the names and default values of a function's arguments. A tuple of four things is returned: ``(args, varargs, varkw, defaults)``. *args* is a list of - the argument names (it may contain nested lists). *varargs* and *varkw* are the - names of the ``*`` and ``**`` arguments or ``None``. *defaults* is a tuple of - default argument values or None if there are no default arguments; if this tuple - has *n* elements, they correspond to the last *n* elements listed in *args*. + the argument names. *varargs* and *varkw* are the names of the ``*`` and + ``**`` arguments or ``None``. *defaults* is a tuple of default argument + values or None if there are no default arguments; if this tuple has *n* + elements, they correspond to the last *n* elements listed in *args*. + + .. deprecated:: 3.0 + Use :func:`getfullargspec` instead, which provides information about + keyword-only arguments. + + +.. function:: getfullargspec(func) + + Get the names and default values of a function's arguments. A tuple of seven + things is returned: + + ``(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. *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 :func:`getargspec`. .. function:: getargvalues(frame) |