8000 bpo-43224: Implement pickling of TypeVarTuples by mrahtz · Pull Request #32119 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43224: Implement pickling of TypeVarTuples #32119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove test_pickling_then_unpickling_variadic_func_results_in_equality
  • Loading branch information
mrahtz committed Apr 15, 2022
commit c5d8dc6ce1b0209699be21cd90efdba153bdd064
28 changes: 0 additions & 28 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,34 +947,6 @@ def test_pickling_then_unpickling_tuple_with_typevartuple_equality(
a2 = pickle.loads(pickle.dumps(a1, proto))
self.assertEqual(a1, a2)

@all_pickle_protocols
def test_pickling_then_unpickling_variadic_func_results_in_equality(
self, proto
):
global T, Ts, a1, b1, c1, d1, e1 # See explanation at start of class.
T = TypeVar('T')
Ts = TypeVarTuple('Ts')

def a1(*args: Unpack[Ts]): pass
a2 = pickle.loads(pickle.dumps(a1, proto))
self.assertEqual(a1, a2)

def b1(*args: Unpack[Tuple[int]]): pass
b2 = pickle.loads(pickle.dumps(b1, proto))
self.assertEqual(b1, b2)

def c1(*args: Unpack[Tuple[int, ...]]): pass
c2 = pickle.loads(pickle.dumps(c1, proto))
self.assertEqual(c1, c2)

def d1(*args: Unpack[Tuple[int, Unpack[Ts]]]): pass
d2 = pickle.loads(pickle.dumps(d1, proto))
self.assertEqual(d1, d2)

def e1(*args: Unpack[Tuple[T, Unpack[Ts]]]): pass
e2 = pickle.loads(pickle.dumps(e1, proto))
self.assertEqual(e1, e2)


class UnionTests(BaseTestCase):

Expand Down
0