Skip to content

Commit 7e099c5

Browse files
[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 74a5171) Co-authored-by: sobolevn <[email protected]>
1 parent 77b411b commit 7e099c5

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)