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 d9df63d commit c7b55e9Copy full SHA for c7b55e9
Lib/collections/__init__.py
@@ -695,6 +695,13 @@ def __repr__(self):
695
#
696
# To strip negative and zero counts, add-in an empty counter:
697
# c += Counter()
698
+ #
699
+ # Rich comparison operators for multiset subset and superset tests
700
+ # are deliberately omitted due to semantic conflicts with the
701
+ # existing inherited dict equality method. Subset and superset
702
+ # semantics ignore zero counts and require that p≤q ∧ p≥q → p=q;
703
+ # however, that would not be the case for p=Counter(a=1, b=0)
704
+ # and q=Counter(a=1) where the dictionaries are not equal.
705
706
def __add__(self, other):
707
'''Add counts from two counters.
0 commit comments