diff options
author | Raymond Hettinger <python@rcn.com> | 2017-01-17 06:42:37 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2017-01-17 06:42:37 (GMT) |
commit | 80490525e0e9c08860b0de0c416dbe71c6593af7 (patch) | |
tree | aabf82fd00fdbfe92a1d416223c5d9849b61c5df /Lib/test | |
parent | a105dd3dc0b054f0d7977e19b682a0016b67790f (diff) | |
download | cpython-80490525e0e9c08860b0de0c416dbe71c6593af7.zip cpython-80490525e0e9c08860b0de0c416dbe71c6593af7.tar.gz cpython-80490525e0e9c08860b0de0c416dbe71c6593af7.tar.bz2 |
Issue #29011: Fix an important omission by adding Deque to the typing module.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_typing.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index d203ce3..7585412 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1572,6 +1572,9 @@ class CollectionsAbcTests(BaseTestCase): def test_list(self): self.assertIsSubclass(list, typing.List) + def test_deque(self): + self.assertIsSubclass(collections.deque, typing.Deque) + def test_set(self): self.assertIsSubclass(set, typing.Set) self.assertNotIsSubclass(frozenset, typing.Set) @@ -1642,6 +1645,14 @@ class CollectionsAbcTests(BaseTestCase): self.assertIsSubclass(MyDefDict, collections.defaultdict) self.assertNotIsSubclass(collections.defaultdict, MyDefDict) + def test_no_deque_instantiation(self): + with self.assertRaises(TypeError): + typing.Deque() + with self.assertRaises(TypeError): + typing.Deque[T]() + with self.assertRaises(TypeError): + typing.Deque[int]() + def test_no_set_instantiation(self): with self.assertRaises(TypeError): typing.Set() |