diff options
author | Raymond Hettinger <python@rcn.com> | 2009-01-21 23:14:07 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-01-21 23:14:07 (GMT) |
commit | 670eaec0ee06654702650a9ce866a98dcf9afed4 (patch) | |
tree | 565416315c9ec5e097fe01f2999408947245684f /Lib/test/test_collections.py | |
parent | e0d1b9f11fc10cc2fb797606dc55967a66821529 (diff) | |
download | cpython-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.py | 5 |
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() |