From: sobolevn Date: Wed, 8 Jan 2025 12:04:54 +0000 (+0300) Subject: gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#128616) X-Git-Tag: v3.14.0a4~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74a517181a9bb65a1f6da149af7427a9fcb3add3;p=thirdparty%2FPython%2Fcpython.git gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#128616) --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index a75dac4a6102..45ba7611059e 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -5182,6 +5182,18 @@ class GenericTests(BaseTestCase): x = pickle.loads(z) self.assertEqual(s, x) + # Test ParamSpec args and kwargs + global PP + PP = ParamSpec('PP') + for thing in [PP.args, PP.kwargs]: + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + with self.subTest(thing=thing, proto=proto): + self.assertEqual( + pickle.loads(pickle.dumps(thing, proto)), + thing, + ) + del PP + def test_copy_and_deepcopy(self): T = TypeVar('T') class Node(Generic[T]): ...