[Python-checkins] gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259) (GH-94268)
serhiy-storchaka
webhook-mailer at python.org
Sun Jun 26 02:01:11 EDT 2022
https://github.com/python/cpython/commit/1901d2a94853b85184a3abbde0f2bd9bba9033c9
commit: 1901d2a94853b85184a3abbde0f2bd9bba9033c9
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2022-06-26T09:01:07+03:00
summary:
gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259) (GH-94268)
(cherry picked from commit 75cb3abc3bf10c7be3b374bfb4c060c36d251411)
Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>
files:
M Lib/test/test_typing.py
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 111a207dd10b3..3f38e30881d4d 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -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):
@@ -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'],
More information about the Python-checkins
mailing list