Skip to content

Commit 1901d2a

Browse files
gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259) (GH-94268)
(cherry picked from commit 75cb3ab) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 5f3b45a commit 1901d2a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_typing.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2144,7 +2144,8 @@ class C(B[int]):
21442144
self.assertEqual(x.bar, 'abc')
21452145
self.assertEqual(x.__dict__, {'foo': 42, 'bar': 'abc'})
21462146
samples = [Any, Union, Tuple, Callable, ClassVar,
2147-
Union[int, str], ClassVar[List], Tuple[int, ...], Callable[[str], bytes],
2147+
Union[int, str], ClassVar[List], Tuple[int, ...], Tuple[()],
2148+
Callable[[str], bytes],
21482149
typing.DefaultDict, typing.FrozenSet[int]]
21492150
for s in samples:
21502151
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
@@ -2162,7 +2163,8 @@ class C(B[int]):
21622163
def test_copy_and_deepcopy(self):
21632164
T = TypeVar('T')
21642165
class Node(Generic[T]): ...
2165-
things = [Union[T, int], Tuple[T, int], Callable[..., T], Callable[[int], int],
2166+
things = [Union[T, int], Tuple[T, int], Tuple[()],
2167+
Callable[..., T], Callable[[int], int],
21662168
Tuple[Any, Any], Node[T], Node[int], Node[Any], typing.Iterable[T],
21672169
typing.Iterable[Any], typing.Iterable[int], typing.Dict[int, str],
21682170
typing.Dict[T, Any], ClassVar[int], ClassVar[List[T]], Tuple['T', 'T'],

0 commit comments

Comments
 (0)