summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2012-02-01 17:08:08 (GMT)
committerRaymond Hettinger <python@rcn.com>2012-02-01 17:08:08 (GMT)
commit590463efc4205337cd231f7bee03e5dabc22063f (patch)
tree9fa29f2574ef8c1386a393ac496d7e14a97f7d0e /Doc/library
parented27785b32f11e815f1029b6b9e393b5c16a7660 (diff)
parentfc3ba6b8fc0d9212cbae676a5c84847245767464 (diff)
downloadcpython-590463efc4205337cd231f7bee03e5dabc22063f.zip
cpython-590463efc4205337cd231f7bee03e5dabc22063f.tar.gz
cpython-590463efc4205337cd231f7bee03e5dabc22063f.tar.bz2
merge
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/itertools.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 3f5c4ea..994a25a 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -534,6 +534,11 @@ loops that truncate the stream.
for i in range(times):
yield object
+ A common use for *repeat* is to supply a stream of constant values to *map*
+ or *zip*::
+
+ >>> list(map(pow, range(10), repeat(2)))
+ [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
.. function:: starmap(function, iterable)