]> granicus.if.org Git - python/commitdiff
Fix error in 2-to-3 translation of docs.
authorRaymond Hettinger <python@rcn.com>
Thu, 14 May 2009 21:48:02 +0000 (21:48 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 14 May 2009 21:48:02 +0000 (21:48 +0000)
Doc/library/itertools.rst

index 899f8c6bdbf4909633c82b879fa1de0c2a5f445e..fa4484d085ff576cbd7f95ad66a2c239cb78991b 100644 (file)
@@ -361,7 +361,7 @@ loops that truncate the stream.
           # islice('ABCDEFG', 2, None) --> C D E F G
           # islice('ABCDEFG', 0, None, 2) --> A C E G
           s = slice(*args)
-          it = range(s.start or 0, s.stop or sys.maxsize, s.step or 1)
+          it = iter(range(s.start or 0, s.stop or sys.maxsize, s.step or 1))
           nexti = next(it)
           for i, element in enumerate(iterable):
               if i == nexti: