From: Raymond Hettinger Date: Thu, 14 May 2009 21:48:02 +0000 (+0000) Subject: Fix error in 2-to-3 translation of docs. X-Git-Tag: v3.1rc1~152 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c8494b6e24b6efcef6386e0bb921cd08ecc68c6;p=python Fix error in 2-to-3 translation of docs. --- diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 899f8c6bdb..fa4484d085 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -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: