this post was submitted on 18 Mar 2024
13 points (88.2% liked)

Python

6368 readers
5 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 3 points 8 months ago (3 children)

Maybe it's just the type of problems I work on, but I never find myself wanting a deque. A queue, absolutely. A stack, sometimes, A priority queue, occasionally.

Never a deque.

[โ€“] [email protected] 1 points 8 months ago

If you want a first in first out it's better than a list. Deque is also whats powering thread safe queues in python where you want said FIFO functionality when sending from one thread to another. (typically the order doesn't matter since it's threads, but generally speaking it makes more sense to take the first thing going in, out of it too.)

load more comments (2 replies)