how to implement a queue-like container with sort function

Ned Batchelder ned at nedbatchelder.com
Tue Dec 3 16:34:02 EST 2013


On 12/3/13 4:19 PM, Cameron Simpson wrote:
> On 04Dec2013 08:17, I wrote:
>> On 02Dec2013 07:26, Ned Batchelder <ned at nedbatchelder.com> wrote:
>>> Actually, I had a long conversation in the #python IRC channel with
>>> the OP at the same time he was posting the question here, and it
>>> turns out he knows exactly how many entries are going into the
>>> "queue", so a plain-old list is the best solution.  I don't know
>>> quite where the idea of limiting the number of entries came from.
>>
>> For me, it was because he said "fill the queue" in the OP. I took
>> that to imply that the queue had a capacity limit.
>
> And then I check the source:-( He actually said "I want to a fixed
> length list-like container". That still sounds like a limit to the
> number of entries.
>
> Cheers,
>

Sorry, I was unclear. When I said, "I don't know where the idea came 
from," I should have said, "the OP said he wanted a fixed-length 
contained, but I don't know why he thinks that."

--Ned.




More information about the Python-list mailing list