From: Terry Jan Reedy Date: Mon, 27 Jan 2014 02:34:25 +0000 (-0500) Subject: Idlelib.calltips: add test of starred first parameters. They should not be X-Git-Tag: v2.7.8~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7ec1be8c7938c56d1f1c4a337e62803a11c84a5;p=python Idlelib.calltips: add test of starred first parameters. They should not be removed even for bound methods. (Inspect.signature does, see 20401.) --- diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltips.py index 9ee30428dc..6415dfc949 100644 --- a/Lib/idlelib/idle_test/test_calltips.py +++ b/Lib/idlelib/idle_test/test_calltips.py @@ -120,6 +120,16 @@ class Get_signatureTest(unittest.TestCase): (tc.__call__, '(ci)'), (tc, '(ci)'), (TC.cm, "(a)"),): self.assertEqual(signature(meth), mtip + "\ndoc") + def test_starred_parameter(self): + # test that starred first parameter is *not* removed from argspec + class C: + def m1(*args): pass + def m2(**kwds): pass + c = C() + for meth, mtip in ((C.m1, '(*args)'), (c.m1, "(*args)"), + (C.m2, "(**kwds)"), (c.m2, "(**kwds)"),): + self.assertEqual(signature(meth), mtip) + def test_no_docstring(self): def nd(s): pass TC.nd = nd