I have a queue (from the Queue
module), and I want to get indexed access into it. (i.e., being able to ask for item number four in the queue, without removing it from the queue.)
I saw that a queue uses a deque internally, and deque has indexed access. The question is, how can I use the deque without (1) messing up the queue, (2) breaking thread-safety.