[3.12] gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (GH-128616) (#128626)
https://github.com/python/cpython/commit/4c130c9238d0bd8d2641f1d2ec667641d8d... commit: 4c130c9238d0bd8d2641f1d2ec667641d8de2abd branch: 3.12 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: AlexWaygood <Alex.Waygood@Gmail.com> date: 2025-01-08T12:25:59Z summary: [3.12] gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (GH-128616) (#128626) Co-authored-by: sobolevn <mail@sobolevn.me> files: M Lib/test/test_typing.py diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index c1057dc3887378..c5f4d775f22fb6 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4838,6 +4838,18 @@ class C(B[int]): 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]): ...
participants (1)
-
AlexWaygood