merge 3.3 (closes #20108)

This commit is contained in:
Benjamin Peterson 2014-01-02 12:26:50 -06:00
commit c22eaecd53
3 changed files with 6 additions and 2 deletions

View file

@ -753,7 +753,7 @@ Classes and functions
metatype is in use, cls will be the first element of the tuple. metatype is in use, cls will be the first element of the tuple.
.. function:: getcallargs(func[, *args][, **kwds]) .. function:: getcallargs(func, *args, **kwds)
Bind the *args* and *kwds* to the argument names of the Python function or Bind the *args* and *kwds* to the argument names of the Python function or
method *func*, as if it was called with them. For bound methods, bind also the method *func*, as if it was called with them. For bound methods, bind also the

View file

@ -1087,12 +1087,14 @@ def _too_many(f_name, args, kwonly, varargs, defcount, given, values):
(f_name, sig, "s" if plural else "", given, kwonly_sig, (f_name, sig, "s" if plural else "", given, kwonly_sig,
"was" if given == 1 and not kwonly_given else "were")) "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. """Get the mapping of arguments to values.
A dict is returned, with keys the function argument names (including the A dict is returned, with keys the function argument names (including the
names of the * and ** arguments, if any), and values the respective bound names of the * and ** arguments, if any), and values the respective bound
values from 'positional' and 'named'.""" values from 'positional' and 'named'."""
func = func_and_positional[0]
positional = func_and_positional[1:]
spec = getfullargspec(func) spec = getfullargspec(func)
args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = spec args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = spec
f_name = func.__name__ f_name = func.__name__

View file

@ -46,6 +46,8 @@ Library
- Fix breakage in TestSuite.countTestCases() introduced by issue #11798. - Fix breakage in TestSuite.countTestCases() introduced by issue #11798.
- Issue #20108: Avoid parameter name clash in inspect.getcallargs().
- Issue #19918: Fix PurePath.relative_to() under Windows. - Issue #19918: Fix PurePath.relative_to() under Windows.
- Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl - Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl