diff options
author | sobolevn <mail@sobolevn.me> | 2025-01-08 12:04:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-08 12:04:54 (GMT) |
commit | 74a517181a9bb65a1f6da149af7427a9fcb3add3 (patch) | |
tree | 4be465bb8bfa2bdd687e07365f3e3e64901691c4 /Lib/test | |
parent | 95cd9c669cdc7718198addb1abb49941a2c61fae (diff) | |
download | cpython-74a517181a9bb65a1f6da149af7427a9fcb3add3.zip cpython-74a517181a9bb65a1f6da149af7427a9fcb3add3.tar.gz cpython-74a517181a9bb65a1f6da149af7427a9fcb3add3.tar.bz2 |
gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#128616)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_typing.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index a75dac4..45ba761 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]): ... |