this post was submitted on 18 Mar 2024
12 points (100.0% liked)

Python

98 readers
1 users here now

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

๐Ÿ“… Events

October 2023

November 2023

PastJuly 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
[โ€“] neo@lemmy.hacktheplanet.be 2 points 6 months ago* (last edited 6 months ago)

I use a deque to fill a queue from the right, items get consumed from the left. Sometimes feedback from an external control mechanism will request an item be added to the queue with high priority. This item is then added to the left of the queue and will get consumed next, before all the others already in the queue. For me this was a good use case for a deque and it works well.