summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-14 22:30:27 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-14 22:30:27 (GMT)
commit4cfd4eac7d082b507a55535f90a7067f372c5e2d (patch)
tree07fb8a4de7ad92e11874908df3c470b2e2f05ca8
parent8aad7f27a4fe285bee9cfc253c374bb611230247 (diff)
downloadcpython-4cfd4eac7d082b507a55535f90a7067f372c5e2d.zip
cpython-4cfd4eac7d082b507a55535f90a7067f372c5e2d.tar.gz
cpython-4cfd4eac7d082b507a55535f90a7067f372c5e2d.tar.bz2
inspect: Test that BoundArguments.__eq__ repects the order of params
-rw-r--r--Lib/test/test_inspect.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 20df755..bbb7afa 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -3133,6 +3133,12 @@ class TestBoundArguments(unittest.TestCase):
ba4 = inspect.signature(bar).bind(1)
self.assertNotEqual(ba, ba4)
+ def foo(*, a, b): pass
+ sig = inspect.signature(foo)
+ ba1 = sig.bind(a=1, b=2)
+ ba2 = sig.bind(b=2, a=1)
+ self.assertEqual(ba1, ba2)
+
def test_signature_bound_arguments_pickle(self):
def foo(a, b, *, c:1={}, **kw) -> {42:'ham'}: pass
sig = inspect.signature(foo)