#22613: minor other fixes in library docs (thanks Jacques Ducasse)

This commit is contained in:
Georg Brandl 2014-10-31 10:25:48 +01:00
parent 2677faecf5
commit 8ed75cd8e9
9 changed files with 35 additions and 30 deletions

View file

@ -750,17 +750,20 @@ Classes and functions
:func:`getargspec` or :func:`getfullargspec`.
The first seven arguments are (``args``, ``varargs``, ``varkw``,
``defaults``, ``kwonlyargs``, ``kwonlydefaults``, ``annotations``). The
other five arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The last argument
is an optional function to format the sequence of arguments. For example::
``defaults``, ``kwonlyargs``, ``kwonlydefaults``, ``annotations``).
>>> from inspect import formatargspec, getfullargspec
>>> def f(a: int, b: float):
... pass
...
>>> formatargspec(*getfullargspec(f))
'(a: int, b: float)'
The other six arguments are functions that are called to turn argument names,
``*`` argument name, ``**`` argument name, default values, return annotation
and individual annotations into strings, respectively.
For example:
>>> from inspect import formatargspec, getfullargspec
>>> def f(a: int, b: float):
... pass
...
>>> formatargspec(*getfullargspec(f))
'(a: int, b: float)'
.. function:: formatargvalues(args[, varargs, varkw, locals, formatarg, formatvarargs, formatvarkw, formatvalue])