mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
[3.10] bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203) (GH-31210)
(cherry picked from commit c8b62bbe46
)
Co-authored-by: Gregory Beauregard <greg@greg.red>
This commit is contained in:
parent
9539400390
commit
cbdcae5ab9
3 changed files with 19 additions and 0 deletions
|
@ -4823,12 +4823,20 @@ class ParamSpecTests(BaseTestCase):
|
|||
|
||||
def test_args_kwargs(self):
|
||||
P = ParamSpec('P')
|
||||
P_2 = ParamSpec('P_2')
|
||||
self.assertIn('args', dir(P))
|
||||
self.assertIn('kwargs', dir(P))
|
||||
self.assertIsInstance(P.args, ParamSpecArgs)
|
||||
self.assertIsInstance(P.kwargs, ParamSpecKwargs)
|
||||
self.assertIs(P.args.__origin__, P)
|
||||
self.assertIs(P.kwargs.__origin__, P)
|
||||
self.assertEqual(P.args, P.args)
|
||||
self.assertEqual(P.kwargs, P.kwargs)
|
||||
self.assertNotEqual(P.args, P_2.args)
|
||||
self.assertNotEqual(P.kwargs, P_2.kwargs)
|
||||
self.assertNotEqual(P.args, P.kwargs)
|
||||
self.assertNotEqual(P.kwargs, P.args)
|
||||
self.assertNotEqual(P.args, P_2.kwargs)
|
||||
self.assertEqual(repr(P.args), "P.args")
|
||||
self.assertEqual(repr(P.kwargs), "P.kwargs")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue