mirror of
https://github.com/python/cpython
synced 2024-10-07 09:24:55 +00:00
avoid parameter name clash (closes #20108)
This commit is contained in:
parent
3a990c69b8
commit
3e6ab1715d
|
@ -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__
|
||||
|
|
Loading…
Reference in a new issue