[Python-checkins] cpython (2.7): Add a usage note
raymond.hettinger
python-checkins at python.org
Wed Feb 1 17:54:25 CET 2012
http://hg.python.org/cpython/rev/0c12790791e6
changeset: 74703:0c12790791e6
branch: 2.7
parent: 74695:822d7a1f8885
user: Raymond Hettinger <python at rcn.com>
date: Wed Feb 01 08:52:44 2012 -0800
summary:
Add a usage note
files:
Doc/library/itertools.rst | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
--- 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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list