]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
use list() to wrap range() in itertools.permutations() example; thanks to Romain...
authorSandro Tosi <sandro.tosi@gmail.com>
Sun, 25 Dec 2011 16:25:45 +0000 (17:25 +0100)
committerSandro Tosi <sandro.tosi@gmail.com>
Sun, 25 Dec 2011 16:25:45 +0000 (17:25 +0100)
Doc/library/itertools.rst

index 28625e8834c41b9b476f2d3caebeb098059e4751..68a6c8307556e71cf386d2b284c055392556f0d9 100644 (file)
@@ -419,7 +419,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)):