diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -720,17 +720,24 @@ Classes and functions Format a pretty argument spec from the values returned by :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. + is an optional function to format the sequence of arguments. 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]) Format a pretty argument spec from the four values returned by :func:`getargvalues`. The format\* arguments are the corresponding optional formatting functions that are called to turn names and values into strings.