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

Skip to content

Commit d75ad44

Browse files
committed
Fix-up doc for itertools.repeat(). A -1 translates to zero repetitions, not infinite repetitions. This matches the behavior of ['x']*n.
1 parent 1ae35ea commit d75ad44

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
@@ -459,7 +459,7 @@ loops that truncate the stream.
459459
yield tuple(prod)
460460

461461

462-
.. function:: repeat(object, times=-1)
462+
.. function:: repeat(object[, times])
463463

464464
Make an iterator that returns *object* over and over again. Runs indefinitely
465465
unless the *times* argument is specified. Used as argument to :func:`map` for

0 commit comments

Comments
 (0)