https://github.com/python/cpython/commit/7e099c51b6404d8d6a5282ac20186d6bd4cda17d
commit: 7e099c51b6404d8d6a5282ac20186d6bd4cda17d
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: sobolevn <[email protected]>
date: 2025-01-08T12:32:32Z
summary:

[3.13] gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` 
(GH-128616) (#128625)

gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (GH-128616)
(cherry picked from commit 74a517181a9bb65a1f6da149af7427a9fcb3add3)

Co-authored-by: sobolevn <[email protected]>

files:
M Lib/test/test_typing.py

diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index cf0406faf11670..140ceb74735570 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -5177,6 +5177,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]): ...

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to