Fix getargspec() doctring (varkw -> keywords).

This commit is contained in:
Guido van Rossum 2014-07-15 12:29:11 -07:00
parent 992334127e
commit e82881cea7
1 changed files with 3 additions and 4 deletions

View File

@ -914,10 +914,9 @@ ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
def getargspec(func): def getargspec(func):
"""Get the names and default values of a function's arguments. """Get the names and default values of a function's arguments.
A tuple of four things is returned: (args, varargs, varkw, defaults). A tuple of four things is returned: (args, varargs, keywords, defaults).
'args' is a list of the argument names. 'args' is a list of the argument names, including keyword-only argument names.
'args' will include keyword-only argument names. 'varargs' and 'keywords' are the names of the * and ** arguments or None.
'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. 'defaults' is an n-tuple of the default values of the last n arguments.
Use the getfullargspec() API for Python 3 code, as annotations Use the getfullargspec() API for Python 3 code, as annotations