Skip to content

Commit

Permalink
pythongh-128615: Cover pickling of ParamSpecArgs and `ParamSpecKwar…
Browse files Browse the repository at this point in the history
…gs` (python#128616)
  • Loading branch information
sobolevn authored Jan 8, 2025
1 parent 95cd9c6 commit 74a5171
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5182,6 +5182,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]): ...
Expand Down

0 comments on commit 74a5171

Please sign in to comment.