From d75ad44aed87865925adbd15930a9aef5901f7c8 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 1 Jun 2009 19:16:52 +0000 Subject: Fix-up doc for itertools.repeat(). A -1 translates to zero repetitions, not infinite repetitions. This matches the behavior of ['x']*n. --- Doc/library/itertools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index e6a9fe2..7baa5e1 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -459,7 +459,7 @@ loops that truncate the stream. yield tuple(prod) -.. function:: repeat(object, times=-1) +.. function:: repeat(object[, times]) Make an iterator that returns *object* over and over again. Runs indefinitely unless the *times* argument is specified. Used as argument to :func:`map` for -- cgit v0.12