diff options
| author | Larry Hastings <larry@hastings.org> | 2017-01-17 00:56:40 -0800 |
|---|---|---|
| committer | Larry Hastings <larry@hastings.org> | 2017-01-17 00:56:40 -0800 |
| commit | 09e4ce5a951d19c96eb078d22e5eacb17d55b8de (patch) | |
| tree | 6579d3607474569d0247d3c0fe46ba218c805540 /Lib/typing.py | |
| parent | c620f200d619a92a5e5b0c76c5ee890894502d7c (diff) | |
| parent | 80490525e0e9c08860b0de0c416dbe71c6593af7 (diff) | |
| download | cpython-git-09e4ce5a951d19c96eb078d22e5eacb17d55b8de.tar.gz | |
Merge 3.5.3 release head with main 3.5 branch.
Diffstat (limited to 'Lib/typing.py')
| -rw-r--r-- | Lib/typing.py | 10 |
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): |
