Skip to content

Commit e04b1f6

Browse files
sobolevnmiss-islington
authored andcommitted
gh-128615: Cover pickling of ParamSpecArgs and ParamSpecKwargs (GH-128616)
(cherry picked from commit 74a5171) Co-authored-by: sobolevn <[email protected]>
1 parent c0ba0bc commit e04b1f6

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
@@ -5177,6 +5177,18 @@ class C(B[int]):
51775177
x = pickle.loads(z)
51785178
self.assertEqual(s, x)
51795179

5180+
# Test ParamSpec args and kwargs
5181+
global PP
5182+
PP = ParamSpec('PP')
5183+
for thing in [PP.args, PP.kwargs]:
5184+
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
5185+
with self.subTest(thing=thing, proto=proto):
5186+
self.assertEqual(
5187+
pickle.loads(pickle.dumps(thing, proto)),
5188+
thing,
5189+
)
5190+
del PP
5191+
51805192
def test_copy_and_deepcopy(self):
51815193
T = TypeVar('T')
51825194
class Node(Generic[T]): ...

0 commit comments

Comments
 (0)