diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-01-02 18:24:08 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-01-02 18:24:08 (GMT) |
commit | 3e6ab1715d13deab644e02e05d978ccb17241176 (patch) | |
tree | 9bb14f84db134c1491a6be9afb9a763651a4f8b9 /Lib | |
parent | 3a990c69b8d8420967010181096e103ebe92406b (diff) | |
download | cpython-3e6ab1715d13deab644e02e05d978ccb17241176.zip cpython-3e6ab1715d13deab644e02e05d978ccb17241176.tar.gz cpython-3e6ab1715d13deab644e02e05d978ccb17241176.tar.bz2 |
avoid parameter name clash (closes #20108)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/inspect.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 9337bd5..680623d 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -985,12 +985,14 @@ def _too_many(f_name, args, kwonly, varargs, defcount, given, values): (f_name, sig, "s" if plural else "", given, kwonly_sig, "was" if given == 1 and not kwonly_given else "were")) -def getcallargs(func, *positional, **named): +def getcallargs(*func_and_positional, **named): """Get the mapping of arguments to values. A dict is returned, with keys the function argument names (including the names of the * and ** arguments, if any), and values the respective bound values from 'positional' and 'named'.""" + func = func_and_positional[0] + positional = func_and_positional[1:] spec = getfullargspec(func) args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = spec f_name = func.__name__ |