The Reliability Whisperer

The Reliability Whisperer

Share this post

The Reliability Whisperer
The Reliability Whisperer
Primer on deque in Python

Primer on deque in Python

when list is just not enough

The Reliability Whisperer's avatar
The Reliability Whisperer
Feb 13, 2025
∙ Paid

Share this post

The Reliability Whisperer
The Reliability Whisperer
Primer on deque in Python
1
Share

Primer on deque in Python

In Python, deque (short for double-ended queue) is part of the collections module. It is optimized for fast append and pop operations from both ends of the sequence, making it a better choice than lists (list) in certain scenarios.

Key Features of deque

  • Fast O(1) operations at both ends (append(), appendleft(), pop(), popleft())

  • Th…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 The Reliability Whisperer
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share