[Python-ideas] Add OrderedSet now that OrderedDict is in collections

MRAB google at mrabarnett.plus.com
Fri May 8 17:00:57 CEST 2009


Mart Sõmermaa wrote:
> On Fri, May 8, 2009 at 4:14 PM, Arnaud Delobelle <arnodel at googlemail.com> wrote:
>> 2009/5/8 Mart Sõmermaa <mrts.pydev at gmail.com>:
>>> As Multiset is arguably quite useless[...]
>> Arguably, it is far from useless.
>>
> Can you perhaps provide a use case where a list (an "ordered
> multiset") does not suffice?
> 
Raymond Hettinger has created a Counter class instead of a strict
multiset class. It's useful for efficiently counting how many times
things occur. Without it you would have to build a dict of counts (I've
done it myself). Practicality beats purity, etc.



More information about the Python-ideas mailing list