https://github.com/python/cpython/commit/7f1e66ae0e7c6bfa26cc128291d8705abd1a3c93
commit: 7f1e66ae0e7c6bfa26cc128291d8705abd1a3c93
branch: main
author: Raymond Hettinger <[email protected]>
committer: rhettinger <[email protected]>
date: 2025-07-11T12:36:17-07:00
summary:
Minor edit: Improve comment readability and ordering (gh-136557)
files:
M Lib/collections/__init__.py
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index d2ddc1cd9ec2ea..b8653f40a942f0 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -776,23 +776,26 @@ def __repr__(self):
# When the multiplicities are all zero or one, multiset operations
# are guaranteed to be equivalent to the corresponding operations
# for regular sets.
+ #
# Given counter multisets such as:
# cp = Counter(a=1, b=0, c=1)
# cq = Counter(c=1, d=0, e=1)
+ #
# The corresponding regular sets would be:
# sp = {'a', 'c'}
# sq = {'c', 'e'}
+ #
# All of the following relations would hold:
- # set(cp + cq) == sp | sq
- # set(cp - cq) == sp - sq
- # set(cp | cq) == sp | sq
- # set(cp & cq) == sp & sq
# (cp == cq) == (sp == sq)
# (cp != cq) == (sp != sq)
# (cp <= cq) == (sp <= sq)
# (cp < cq) == (sp < sq)
# (cp >= cq) == (sp >= sq)
# (cp > cq) == (sp > sq)
+ # set(cp + cq) == sp | sq
+ # set(cp - cq) == sp - sq
+ # set(cp | cq) == sp | sq
+ # set(cp & cq) == sp & sq
def __eq__(self, other):
'True if all counts agree. Missing counts are treated as zero.'
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]