fifo queue

Paul Rubin http
Sun Mar 18 18:51:58 EDT 2007


Unless the queue is really large, just use the pop operation to get
stuff off the top of the queue.  That causes O(n) operations but it
should be fast if n is small.

    class queue(list):
        push = append
        def pop(self):
            return list.pop(self,0)

should do about what you wrote.



More information about the Python-list mailing list