cpython: 4ff1dc8c0a3c (original) (raw)

Mercurial > cpython

changeset 81832:4ff1dc8c0a3c

Issue #17071: Signature.bind() now works when one of the keyword arguments is named self. [#17071]

Antoine Pitrou solipsis@pitrou.net
date Tue, 29 Jan 2013 21:21:56 +0100
parents e24fd2c35d27(current diff)49fd1c8aeca5(diff)
children 0880e0f859e0
files Lib/inspect.py Lib/test/test_inspect.py Misc/NEWS
diffstat 3 files changed, 18 insertions(+), 5 deletions(-)[+] [-] Lib/inspect.py 8 Lib/test/test_inspect.py 10 Misc/NEWS 5

line wrap: on

line diff

--- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2028,19 +2028,19 @@ class Signature: return self._bound_arguments_cls(self, arguments)

def str(self): result = []

--- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -2241,6 +2241,16 @@ class TestSignatureBind(unittest.TestCas with self.assertRaisesRegex(TypeError, "parameter is positional only"): self.call(test, a_po=1, b_po=2)

+ class TestBoundArguments(unittest.TestCase): def test_signature_bound_arguments_unhashable(self):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -236,10 +236,13 @@ Core and Builtins Library ------- +- Issue #17071: Signature.bind() now works when one of the keyword arguments