[issue40755] Add missing multiset predicates to collections.Counter

Raymond Hettinger report at bugs.python.org
Thu May 28 11:41:30 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I would also have preferred to use the operators <, >, <=, >=, and ==.  The docs in the patch explain why we can't go down this path.

Also, while counters have support for multiset operations, they continue to support other use cases a well (negative counts and fractional counts). That support can't be removed without breaking existing code that relies on it.

>From the outset, a Counter was just a dictionary that return 0 for missing keys.  Users are free to use that concept however they want.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40755>
_______________________________________


More information about the Python-bugs-list mailing list