[Python-Dev] FIFO data structure?
Sun, 20 Apr 2003 05:16:01 -0400
-----BEGIN PGP SIGNED MESSAGE-----
2.3 seems to focus somewhat on adding a wider variety of data structures to
Python -- well, sets and heapq, at least :) One thing I've found lacking,
though, is a nice O(1) FIFO queue -- even the standard Queue module
underlying uses a list as a queue, which means the dequeue operation is O(N)
in the size of the queue. I'm curious what the possiblity of getting a queue
module (which would probably have to be named "fifo", since Queue is already
taken and some operating systems use case-insensitive filesystems) added to
the standard library would be.
If it is a possibility, I have a pure-Python implementation using the
mechanism described at
The module itself is at <http://www.cis.ohio-state.edu/fifo.py>; the tests
are at <http://www.cis.ohio-state.edu/test_fifo.py>.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)
-----END PGP SIGNATURE-----