mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-128615: Cover pickling of ParamSpecArgs and ParamSpecKwargs (#128616)
This commit is contained in:
parent
95cd9c669c
commit
74a517181a
1 changed files with 12 additions and 0 deletions
|
|
@ -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]): ...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue