Alexey Volkov <alexey.vol...@ark-kun.com> added the comment:

>Why not just dismiss older queue entries during a normal get() operation?  Or 
>just use a plain deque with access guarded by a lock.

You do not know whether the item needs to be removed until you see it. And to 
see it you need to get it. And if you get it, you cannot push it back to the 
start of the queue.

>FWIW, the standard library queue module doesn't have a straight-forward way to 
>implement a peek() method.

I currently use `q.deque[0]`

>Or just use a plain deque with access guarded by a lock.

I can. But technically the same applies to almost any queue usage.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35118>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to