We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2510494 commit 4cc4d60Copy full SHA for 4cc4d60
Lib/collections/__init__.py
@@ -711,6 +711,13 @@ def __repr__(self):
711
#
712
# To strip negative and zero counts, add-in an empty counter:
713
# c += Counter()
714
+ #
715
+ # Rich comparison operators for multiset subset and superset tests
716
+ # are deliberately omitted due to semantic conflicts with the
717
+ # existing inherited dict equality method. Subset and superset
718
+ # semantics ignore zero counts and require that p≤q ∧ p≥q → p=q;
719
+ # however, that would not be the case for p=Counter(a=1, b=0)
720
+ # and q=Counter(a=1) where the dictionaries are not equal.
721
722
def __add__(self, other):
723
'''Add counts from two counters.
0 commit comments