The collections module in Python 2.7 and Python 3.1 has gotten a new Counter class that works like bags and multisets in other languages.
I've adapted it for Python2.5/2.6 so people can start using it right away: http://docs.python.org/dev/library/collections.html#counter-objects Here's a link to the docs for the new class: http://code.activestate.com/recipes/576611/ Raymond -- http://mail.python.org/mailman/listinfo/python-list