[Python-checkins] cpython: inspect.Signature.bind: Update method signature to rule out possiblity
yury.selivanov
python-checkins at python.org
Wed Jan 29 18:10:42 CET 2014
http://hg.python.org/cpython/rev/379d9a193539
changeset: 88815:379d9a193539
user: Yury Selivanov <yselivanov at sprymix.com>
date: Wed Jan 29 12:10:27 2014 -0500
summary:
inspect.Signature.bind: Update method signature to rule out possiblity
of name conflict between '__bind_self' and actual keyword argument to
'bind' or 'bind_partial'.
files:
Lib/inspect.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Lib/inspect.py b/Lib/inspect.py
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -2470,19 +2470,19 @@
return self._bound_arguments_cls(self, arguments)
- def bind(__bind_self, *args, **kwargs):
+ def bind(*args, **kwargs):
'''Get a BoundArguments object, that maps the passed `args`
and `kwargs` to the function's signature. Raises `TypeError`
if the passed arguments can not be bound.
'''
- return __bind_self._bind(args, kwargs)
-
- def bind_partial(__bind_self, *args, **kwargs):
+ return args[0]._bind(args[1:], kwargs)
+
+ def bind_partial(*args, **kwargs):
'''Get a BoundArguments object, that partially maps the
passed `args` and `kwargs` to the function's signature.
Raises `TypeError` if the passed arguments can not be bound.
'''
- return __bind_self._bind(args, kwargs, partial=True)
+ return args[0]._bind(args[1:], kwargs, partial=True)
def __str__(self):
result = []
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list