[Python-3000-checkins] r58124 - python/branches/py3k/Doc/library/inspect.rst

georg.brandl python-3000-checkins at python.org
Wed Sep 12 21:04:22 CEST 2007


Author: georg.brandl
Date: Wed Sep 12 21:04:21 2007
New Revision: 58124

Modified:
   python/branches/py3k/Doc/library/inspect.rst
Log:
Document inspect.getfullargspec(). Fixes #1121.


Modified: python/branches/py3k/Doc/library/inspect.rst
==============================================================================
--- python/branches/py3k/Doc/library/inspect.rst	(original)
+++ python/branches/py3k/Doc/library/inspect.rst	Wed Sep 12 21:04:21 2007
@@ -376,10 +376,31 @@
 
    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)


More information about the Python-3000-checkins mailing list