diff options
author | Georg Brandl <georg@python.org> | 2014-10-31 09:25:48 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-31 09:25:48 (GMT) |
commit | 8ed75cd8e931c075c38246fbd50dd5f18defdba6 (patch) | |
tree | 7d7ce1750916737af0a92d0c9b47163abb5cec3f /Doc/library/inspect.rst | |
parent | 2677faecf5c967b1078eb2de94a32d5f722511e4 (diff) | |
download | cpython-8ed75cd8e931c075c38246fbd50dd5f18defdba6.zip cpython-8ed75cd8e931c075c38246fbd50dd5f18defdba6.tar.gz cpython-8ed75cd8e931c075c38246fbd50dd5f18defdba6.tar.bz2 |
#22613: minor other fixes in library docs (thanks Jacques Ducasse)
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r-- | Doc/library/inspect.rst | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 0c08712..a7c127c 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -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]) |