mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #17071: Signature.bind() now works when one of the keyword arguments is named self.
This commit is contained in:
commit
64a5562f4c
3 changed files with 18 additions and 5 deletions
|
@ -2028,19 +2028,19 @@ class Signature:
|
|||
|
||||
return self._bound_arguments_cls(self, arguments)
|
||||
|
||||
def bind(self, *args, **kwargs):
|
||||
def bind(__bind_self, *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 self._bind(args, kwargs)
|
||||
return __bind_self._bind(args, kwargs)
|
||||
|
||||
def bind_partial(self, *args, **kwargs):
|
||||
def bind_partial(__bind_self, *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 self._bind(args, kwargs, partial=True)
|
||||
return __bind_self._bind(args, kwargs, partial=True)
|
||||
|
||||
def __str__(self):
|
||||
result = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue