]> granicus.if.org Git - python/commitdiff
Use xrange in the example
authorRaymond Hettinger <python@rcn.com>
Wed, 1 Feb 2012 16:55:21 +0000 (08:55 -0800)
committerRaymond Hettinger <python@rcn.com>
Wed, 1 Feb 2012 16:55:21 +0000 (08:55 -0800)
Doc/library/itertools.rst

index 9b3f1c122067b1744cf6095bf106e173e7df03ac..a553d09964e345215f43048192fab1e646b33425 100644 (file)
@@ -593,7 +593,7 @@ loops that truncate the stream.
    A common use for *repeat* is to supply a stream of constant values to *imap*
    or *zip*::
 
-      >>> list(imap(pow, range(10), repeat(2)))
+      >>> list(imap(pow, xrange(10), repeat(2)))
       [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
 
 .. function:: starmap(function, iterable)