use list() to wrap range() in itertools.permutations() example; thanks to Romain MORLEVAT from docs@

This commit is contained in:
Sandro Tosi 2011-12-25 17:25:45 +01:00
parent 3e6c814b9d
commit 7386662699

View 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)):