]> granicus.if.org Git - python/commitdiff
inspect: Test that BoundArguments.__eq__ repects the order of params
authorYury Selivanov <yselivanov@sprymix.com>
Thu, 14 May 2015 22:30:27 +0000 (18:30 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Thu, 14 May 2015 22:30:27 +0000 (18:30 -0400)
Lib/test/test_inspect.py

index 20df755a46bb97a3722c57db6fa8c4c075f201ff..bbb7afa7bad0dc316832e15ed33da7270e96ed54 100644 (file)
@@ -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)