Skip to content

Commit 4c130c9

Browse files
[3.12] gh-128615: Cover pickling of ParamSpecArgs and ParamSpecKwargs (GH-128616) (#128626)
Co-authored-by: sobolevn <[email protected]>
1 parent b69b9da commit 4c130c9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Lib/test/test_typing.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4838,6 +4838,18 @@ class C(B[int]):
48384838
x = pickle.loads(z)
48394839
self.assertEqual(s, x)
48404840

4841+
# Test ParamSpec args and kwargs
4842+
global PP
4843+
PP = ParamSpec('PP')
4844+
for thing in [PP.args, PP.kwargs]:
4845+
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
4846+
with self.subTest(thing=thing, proto=proto):
4847+
self.assertEqual(
4848+
pickle.loads(pickle.dumps(thing, proto)),
4849+
thing,
4850+
)
4851+
del PP
4852+
48414853
def test_copy_and_deepcopy(self):
48424854
T = TypeVar('T')
48434855
class Node(Generic[T]): ...

0 commit comments

Comments
 (0)