summaryrefslogtreecommitdiff
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2017-01-16 22:44:14 -0800
committerRaymond Hettinger <python@rcn.com>2017-01-16 22:44:14 -0800
commitf6b96c7bb59ac7bc97fc00a823e70de48b693d9a (patch)
tree63ad342da904d5de5a73bc04f50e9a4e5ef6f6e4 /Lib/typing.py
parentb05cbac05272df8daf620b4f464f5874b54b61a8 (diff)
parente12c313f5e2690d61f99f2fb6a98e7992ff7e12c (diff)
downloadcpython-git-f6b96c7bb59ac7bc97fc00a823e70de48b693d9a.tar.gz
merge
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 34845b747a..2821c3cb2d 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -59,6 +59,7 @@ __all__ = [
'SupportsRound',
# Concrete collection types.
+ 'Deque',
'Dict',
'DefaultDict',
'List',
@@ -1771,6 +1772,15 @@ class List(list, MutableSequence[T], extra=list):
"use list() instead")
return _generic_new(list, cls, *args, **kwds)
+class Deque(collections.deque, MutableSequence[T], extra=collections.deque):
+
+ __slots__ = ()
+
+ def __new__(cls, *args, **kwds):
+ if _geqv(cls, Deque):
+ raise TypeError("Type Deque cannot be instantiated; "
+ "use deque() instead")
+ return _generic_new(collections.deque, cls, *args, **kwds)
class Set(set, MutableSet[T], extra=set):