diff options
author | Ivan Levkivskyi <levkivskyi@gmail.com> | 2018-04-05 00:25:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-05 00:25:15 (GMT) |
commit | 2a363d2930e29ec6d8a774973ed5a4965f881f5f (patch) | |
tree | ed4bc9f9723c14f810e0b7b7dd5496c9226c0b47 /Lib/test/test_typing.py | |
parent | ee566fe526f3d069aa313578ee81ca6cbc25ff52 (diff) | |
download | cpython-2a363d2930e29ec6d8a774973ed5a4965f881f5f.zip cpython-2a363d2930e29ec6d8a774973ed5a4965f881f5f.tar.gz cpython-2a363d2930e29ec6d8a774973ed5a4965f881f5f.tar.bz2 |
bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376)
This removes a hack and replaces it with a proper
mapping {'list': 'List', 'dict': 'Dict', ...}.
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index b12e5ea..390fe60 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1058,14 +1058,15 @@ class GenericTests(BaseTestCase): 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, ...], Callable[[str], bytes], + typing.DefaultDict, typing.FrozenSet[int]] for s in samples: for proto in range(pickle.HIGHEST_PROTOCOL + 1): z = pickle.dumps(s, proto) x = pickle.loads(z) self.assertEqual(s, x) more_samples = [List, typing.Iterable, typing.Type, List[int], - typing.Type[typing.Mapping]] + typing.Type[typing.Mapping], typing.AbstractSet[Tuple[int, str]]] for s in more_samples: for proto in range(pickle.HIGHEST_PROTOCOL + 1): z = pickle.dumps(s, proto) |