Skip to content

Commit

Permalink
gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259) (G…
Browse files Browse the repository at this point in the history
…H-94268)

(cherry picked from commit 75cb3ab)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
miss-islington and serhiy-storchaka committed Jun 26, 2022
1 parent 5f3b45a commit 1901d2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,8 @@ class C(B[int]):
self.assertEqual(x.bar, 'abc')
self.assertEqual(x.__dict__, {'foo': 42, 'bar': 'abc'})
samples = [Any, Union, Tuple, Callable, ClassVar,
Union[int, str], ClassVar[List], Tuple[int, ...], Callable[[str], bytes],
Union[int, str], ClassVar[List], Tuple[int, ...], Tuple[()],
Callable[[str], bytes],
typing.DefaultDict, typing.FrozenSet[int]]
for s in samples:
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
Expand All @@ -2162,7 +2163,8 @@ class C(B[int]):
def test_copy_and_deepcopy(self):
T = TypeVar('T')
class Node(Generic[T]): ...
things = [Union[T, int], Tuple[T, int], Callable[..., T], Callable[[int], int],
things = [Union[T, int], Tuple[T, int], Tuple[()],
Callable[..., T], Callable[[int], int],
Tuple[Any, Any], Node[T], Node[int], Node[Any], typing.Iterable[T],
typing.Iterable[Any], typing.Iterable[int], typing.Dict[int, str],
typing.Dict[T, Any], ClassVar[int], ClassVar[List[T]], Tuple['T', 'T'],
Expand Down

0 comments on commit 1901d2a

Please sign in to comment.