Issue #29011: Fix an important omission by adding Deque to the typing module.
diff --git a/Lib/typing.py b/Lib/typing.py
index 34845b7..2821c3c 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -59,6 +59,7 @@
'SupportsRound',
# Concrete collection types.
+ 'Deque',
'Dict',
'DefaultDict',
'List',
@@ -1771,6 +1772,15 @@
"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):