summaryrefslogtreecommitdiffstats
path: root/Doc/library/collections.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-01-20 13:00:59 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-01-20 13:00:59 (GMT)
commit0bae662559bf1b18fe4de41a3dda54243ccea689 (patch)
tree41ae4208ed1ce475de1b8b295e66a56c55f1bb2c /Doc/library/collections.rst
parent4f7945f3b34bc3f3b953467731b1cf7185a5d1e6 (diff)
downloadcpython-0bae662559bf1b18fe4de41a3dda54243ccea689.zip
cpython-0bae662559bf1b18fe4de41a3dda54243ccea689.tar.gz
cpython-0bae662559bf1b18fe4de41a3dda54243ccea689.tar.bz2
Fix typos.
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r--Doc/library/collections.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 8b726fa..1936c30 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -157,7 +157,7 @@ For example::
# Find the ten most common words in Hamlet
>>> import re
>>> words = re.findall('\w+', open('hamlet.txt').read().lower())
- >>> Counter(hamlet_words).most_common(10)
+ >>> Counter(words).most_common(10)
[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),
('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]
@@ -206,7 +206,7 @@ For example::
Elements are returned in arbitrary order. If an element's count has been
set to zero or a negative number, :meth:`elements` will ignore it.
- >>> c = Counter(a=4, b=2, c=0, d=-2)
+ >>> c = Counter(a=4, b=2, c=0, d=-2)
>>> list(c.elements())
['a', 'a', 'a', 'a', 'b', 'b']
@@ -261,7 +261,7 @@ subtraction combine counters by adding or subtracting the counts of
corresponding elements. Intersection and union return the minimum and maximum
of corresponding counts::
- >>> c = Counter('a': 3, 'b': 1})
+ >>> c = Counter({'a': 3, 'b': 1})
>>> d = Counter({'a': 1, 'b': 2})
>>> c + d # add two counters together: c[x] + d[x]
Counter({'a': 4, 'b': 3})