8000 gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#… · python/cpython@74a5171 · GitHub
[go: up one dir, main page]

Skip to content

Commit 74a5171

Browse files
authored
gh-128615: Cover pickling of ParamSpecArgs and ParamSpecKwargs (#128616)
1 parent 95cd9c6 commit 74a5171

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
@@ -5182,6 +5182,18 @@ class C(B[int]):
51825182
x = pickle.loads(z)
51835183
self.assertEqual(s, x)
51845184

5185+
# Test ParamSpec args and kwargs
5186+
global PP
5187+
PP = ParamSpec('PP')
5188+
for thing in [PP.args, PP.kwargs]:
5189+
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
5190+
with self.subTest(thing=thing, proto=proto):
5191+
self.assertEqual(
5192+
pickle.loads(pickle.dumps(thing, proto)),
5193+
thing,
5194+
)
5195+
del PP
5196+
51855197
def test_copy_and_deepcopy(self):
51865198
T = TypeVar('T')
51875199
class Node(Generic[T]): ...

0 commit comments

Comments
 (0)
0