From: Raymond Hettinger Date: Wed, 1 Feb 2012 16:52:44 +0000 (-0800) Subject: Add a usage note X-Git-Tag: v2.7.3rc1~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdb7fe4c843c0290acfd8e4b194a90870ad9f733;p=thirdparty%2FPython%2Fcpython.git Add a usage note --- diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 36a391b4095e..21465e5721b2 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -590,6 +590,11 @@ loops that truncate the stream. for i in xrange(times): yield object + A common use for *repeat* is to supply a stream of constant values to *imap* + or *zip*:: + + >>> list(imap(pow, range(10), repeat(2))) + [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] .. function:: starmap(function, iterable)