Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7386662

Browse files
committed
use list() to wrap range() in itertools.permutations() example; thanks to Romain MORLEVAT from docs@
1 parent 3e6c814 commit 7386662

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/itertools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ loops that truncate the stream.
419419
if r > n:
420420
return
421421
indices = list(range(n))
422-
cycles = range(n, n-r, -1)
422+
cycles = list(range(n, n-r, -1))
423423
yield tuple(pool[i] for i in indices[:r])
424424
while n:
425425
for i in reversed(range(r)):

0 commit comments

Comments
 (0)