diff options
author | Georg Brandl <georg@python.org> | 2014-10-31 09:39:29 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-31 09:39:29 (GMT) |
commit | e21a531ef10e120a94434b3d4806a8106dd6f271 (patch) | |
tree | 0b1d0245388effa5cbf130744b50af6ab6a1eb5f /Doc/library/inspect.rst | |
parent | fe98180bced16be7d62b762cc85d400f929d0885 (diff) | |
parent | a4c8c47961305487ef6c40a6d882bb956f2c5a0b (diff) | |
download | cpython-e21a531ef10e120a94434b3d4806a8106dd6f271.zip cpython-e21a531ef10e120a94434b3d4806a8106dd6f271.tar.gz cpython-e21a531ef10e120a94434b3d4806a8106dd6f271.tar.bz2 |
merge with 3.4
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 2e209eb..3ac66d8 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -786,17 +786,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]) |