summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-01-21 23:14:07 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-01-21 23:14:07 (GMT)
commit670eaec0ee06654702650a9ce866a98dcf9afed4 (patch)
tree565416315c9ec5e097fe01f2999408947245684f /Lib/test/test_collections.py
parente0d1b9f11fc10cc2fb797606dc55967a66821529 (diff)
downloadcpython-670eaec0ee06654702650a9ce866a98dcf9afed4.zip
cpython-670eaec0ee06654702650a9ce866a98dcf9afed4.tar.gz
cpython-670eaec0ee06654702650a9ce866a98dcf9afed4.tar.bz2
Tighten-up the docs for Counter().
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 7195634..79e64e6 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -453,6 +453,11 @@ class TestCounter(unittest.TestCase):
self.assertEqual(dict(Counter(s)), dict(Counter(s).items()))
self.assertEqual(set(Counter(s)), set(s))
+ def test_invariant_for_the_in_operator(self):
+ c = Counter(a=10, b=-2, c=0)
+ for elem in c:
+ self.assert_(elem in c)
+
def test_multiset_operations(self):
# Verify that adding a zero counter will strip zeros and negatives
c = Counter(a=10, b=-2, c=0) + Counter()