Skip to content

Commit 7f1e66a

Browse files
authored
Minor edit: Improve comment readability and ordering (gh-136557)
1 parent 561212a commit 7f1e66a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Lib/collections/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,23 +776,26 @@ def __repr__(self):
776776
# When the multiplicities are all zero or one, multiset operations
777777
# are guaranteed to be equivalent to the corresponding operations
778778
# for regular sets.
779+
#
779780
# Given counter multisets such as:
780781
# cp = Counter(a=1, b=0, c=1)
781782
# cq = Counter(c=1, d=0, e=1)
783+
#
782784
# The corresponding regular sets would be:
783785
# sp = {'a', 'c'}
784786
# sq = {'c', 'e'}
787+
#
785788
# All of the following relations would hold:
786-
# set(cp + cq) == sp | sq
787-
# set(cp - cq) == sp - sq
788-
# set(cp | cq) == sp | sq
789-
# set(cp & cq) == sp & sq
790789
# (cp == cq) == (sp == sq)
791790
# (cp != cq) == (sp != sq)
792791
# (cp <= cq) == (sp <= sq)
793792
# (cp < cq) == (sp < sq)
794793
# (cp >= cq) == (sp >= sq)
795794
# (cp > cq) == (sp > sq)
795+
# set(cp + cq) == sp | sq
796+
# set(cp - cq) == sp - sq
797+
# set(cp | cq) == sp | sq
798+
# set(cp & cq) == sp & sq
796799

797800
def __eq__(self, other):
798801
'True if all counts agree. Missing counts are treated as zero.'

0 commit comments

Comments
 (0)