From: Raymond Hettinger Date: Mon, 1 Jun 2009 19:16:52 +0000 (+0000) Subject: Fix-up doc for itertools.repeat(). A -1 translates to zero repetitions, not infinite... X-Git-Tag: v3.1rc2~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d75ad44aed87865925adbd15930a9aef5901f7c8;p=python Fix-up doc for itertools.repeat(). A -1 translates to zero repetitions, not infinite repetitions. This matches the behavior of ['x']*n. --- diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index e6a9fe2e71..7baa5e10de 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