summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-01-29 17:10:27 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-01-29 17:10:27 (GMT)
commitc45873e4349fcec76870757b43fe24a85b443755 (patch)
tree9ef8a1d02a356e6fa2e511f1a548fdc163150f5d /Lib/inspect.py
parent421f0c7be1286e617eb6c00e98a512ce3993d222 (diff)
downloadcpython-c45873e4349fcec76870757b43fe24a85b443755.zip
cpython-c45873e4349fcec76870757b43fe24a85b443755.tar.gz
cpython-c45873e4349fcec76870757b43fe24a85b443755.tar.bz2
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'.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index e83a222..fbea3df 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -2470,19 +2470,19 @@ class Signature:
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)
+ return args[0]._bind(args[1:], kwargs)
- def bind_partial(__bind_self, *args, **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 = []