commit | bdb7fe4c843c0290acfd8e4b194a90870ad9f733 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Wed Feb 01 08:52:44 2012 -0800 |
committer | Raymond Hettinger <python@rcn.com> | Wed Feb 01 08:52:44 2012 -0800 |
tree | 98fa2214262911431fbef0e32280922e288ff858 | |
parent | 1d4ae48f48b2da82a89769a714644eb55a541888 [diff] [blame] |
Add a usage note
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 36a391b..21465e5 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst
@@ -590,6 +590,11 @@ 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)