diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 7b5922ae836..3f5c4ea58ab 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -457,7 +457,7 @@ loops that truncate the stream. if r > n: return indices = list(range(n)) - cycles = range(n, n-r, -1) + cycles = list(range(n, n-r, -1)) yield tuple(pool[i] for i in indices[:r]) while n: for i in reversed(range(r)):