https://github.com/python/cpython/commit/78e868fa28dd8c913895399d9aba6828dc40fc20
commit: 78e868fa28dd8c913895399d9aba6828dc40fc20
branch: main
author: Heikki Toivonen <[email protected]>
committer: rhettinger <[email protected]>
date: 2026-01-10T00:17:57-06:00
summary:

gh-143586: Add Counter comparison tests to enforce missing element semantics 
(gh-143587)

files:
M Lib/test/test_collections.py

diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index fad639b20a1801..b1b2dd2ca5ca0d 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -2423,6 +2423,8 @@ def test_eq(self):
 
     def test_le(self):
         self.assertTrue(Counter(a=3, b=2, c=0) <= Counter('ababa'))
+        self.assertTrue(Counter() <= Counter(c=1))
+        self.assertFalse(Counter() <= Counter(c=-1))
         self.assertFalse(Counter(a=3, b=2) <= Counter('babab'))
 
     def test_lt(self):
@@ -2431,6 +2433,8 @@ def test_lt(self):
 
     def test_ge(self):
         self.assertTrue(Counter(a=2, b=1, c=0) >= Counter('aab'))
+        self.assertTrue(Counter() >= Counter(c=-1))
+        self.assertFalse(Counter() >= Counter(c=1))
         self.assertFalse(Counter(a=3, b=2, c=0) >= Counter('aabd'))
 
     def test_gt(self):

_______________________________________________
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]

Reply via email to