summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-01 16:43:12 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-01 16:43:12 (GMT)
commit8ea999930c9af7226057de343fa38b8bf0f5aeb1 (patch)
treec3b45a18f844d5e44b6677bd2e11eff7ab20984b /Doc/library
parent99a1b20bbf906299a7ea7b871f290dee580a3f18 (diff)
downloadcpython-8ea999930c9af7226057de343fa38b8bf0f5aeb1.zip
cpython-8ea999930c9af7226057de343fa38b8bf0f5aeb1.tar.gz
cpython-8ea999930c9af7226057de343fa38b8bf0f5aeb1.tar.bz2
fix highlighting
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/itertools.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index db38e69..e0a55bd 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -547,7 +547,7 @@ can be combined.
.. doctest::
- # Show a dictionary sorted and grouped by value
+ >>> # Show a dictionary sorted and grouped by value
>>> from operator import itemgetter
>>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3)
>>> di = sorted(d.iteritems(), key=itemgetter(1))
@@ -558,9 +558,9 @@ can be combined.
2 ['b', 'd', 'f']
3 ['g']
- # Find runs of consecutive numbers using groupby. The key to the solution
- # is differencing with a range so that consecutive numbers all appear in
- # same group.
+ >>> # Find runs of consecutive numbers using groupby. The key to the solution
+ >>> # is differencing with a range so that consecutive numbers all appear in
+ >>> # same group.
>>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28]
>>> for k, g in groupby(enumerate(data), lambda (i,x):i-x):
... print map(itemgetter(1), g)