[Python-Dev] collections module

Christian Tanzer tanzer at swing.co.at
Fri Jan 9 12:12:56 EST 2004

"Raymond Hettinger" <python at rcn.com> wrote:

> I would like to establish a new module for some collection classes.

I'd prefer a package. The number of collection classes is bound to
increase over time and a module with too many classes sucks (been
there, done that :-)

> Guido wanted this to be discussed by a number of people.  While
> a rich set of collection classes have proven their worth in other
> contexts, it could be that more is not better for python.  One the
> language's elegances is the ability to do just about anything with
> just lists and dicts.  If you have too many mutable containers to
> choose from, the choice of which to use becomes less obvious.

I used Python for more than five years before I really needed something
else than lists and dicts (that includes using lists for stacks and

But quite recently I had to implement a doubly-linked list. Using that
made the code in question substantially easier.

I'd like to see things like a queue in the standard library. Maybe
even a stack would be nice (maybe I've just seen too many attempts
pushing/popping at the front of a list -:)

Christian Tanzer                                    http://www.c-tanzer.at/

More information about the Python-Dev mailing list