]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix error in 2-to-3 translation of docs.
authorRaymond Hettinger <python@rcn.com>
Thu, 14 May 2009 21:52:15 +0000 (21:52 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 14 May 2009 21:52:15 +0000 (21:52 +0000)
Doc/library/itertools.rst

index 9e3a6355051b9c3231005db13153f7198b6aa088..587cfc1b66358822a6b3750108a093a689bcd63d 100644 (file)
@@ -294,7 +294,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: