API Reference / Classes / collections / deque deque Standard library class collections.deque View source class deque class deque[T] Fields 1 T type Constructors 4 __init__ __init__(self: Self, /) Defined in collections __init__ __init__(self: Self, /, maxlen: int) Defined in collections __init__ __init__(self: Self, /, it: Generator[T]) Defined in collections __init__ __init__(self: Self, /, other: deque[T]) Defined in collections Properties 2 maxlen @property maxlen(self: Self) -> int Defined in collections left @property left(self: Self) -> T Defined in collections Methods 6 appendleft appendleft(self: Self, x: T, /) Defined in collections append append(self: Self, x: T, /) Defined in collections popleft popleft(self: Self, /) -> T Defined in collections pop pop(self: Self, /) -> T Defined in collections clear clear(self: Self, /) Defined in collections copy copy(self: Self, /) -> deque[T] Defined in collections Special methods 8 __bool__ __bool__(self: Self) -> bool Defined in collections __len__ __len__(self: Self, /) -> int Defined in collections __iter__ __iter__(self: Self, /) -> Generator[T] Defined in collections __contains__ __contains__(self: Self, x: T, /) -> bool Defined in collections __deepcopy__ __deepcopy__(self: Self) -> deque[T] Defined in collections __copy__ __copy__(self: Self, /) -> deque[T] Defined in collections __repr__ __repr__(self: Self, /) -> str Defined in collections __getitem__ __getitem__(self: Self, idx: int, /) -> T Defined in collections
class deque class deque[T] Fields 1 T type Constructors 4 __init__ __init__(self: Self, /) Defined in collections __init__ __init__(self: Self, /, maxlen: int) Defined in collections __init__ __init__(self: Self, /, it: Generator[T]) Defined in collections __init__ __init__(self: Self, /, other: deque[T]) Defined in collections Properties 2 maxlen @property maxlen(self: Self) -> int Defined in collections left @property left(self: Self) -> T Defined in collections Methods 6 appendleft appendleft(self: Self, x: T, /) Defined in collections append append(self: Self, x: T, /) Defined in collections popleft popleft(self: Self, /) -> T Defined in collections pop pop(self: Self, /) -> T Defined in collections clear clear(self: Self, /) Defined in collections copy copy(self: Self, /) -> deque[T] Defined in collections Special methods 8 __bool__ __bool__(self: Self) -> bool Defined in collections __len__ __len__(self: Self, /) -> int Defined in collections __iter__ __iter__(self: Self, /) -> Generator[T] Defined in collections __contains__ __contains__(self: Self, x: T, /) -> bool Defined in collections __deepcopy__ __deepcopy__(self: Self) -> deque[T] Defined in collections __copy__ __copy__(self: Self, /) -> deque[T] Defined in collections __repr__ __repr__(self: Self, /) -> str Defined in collections __getitem__ __getitem__(self: Self, idx: int, /) -> T Defined in collections