commit | fc3ba6b8fc0d9212cbae676a5c84847245767464 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Wed Feb 01 09:07:40 2012 -0800 |
committer | Raymond Hettinger <python@rcn.com> | Wed Feb 01 09:07:40 2012 -0800 |
tree | b6e131c6286c0c0f31b5b7c8e28c702b288e4965 | |
parent | 4d82ade42471e0503d82012116d0b128d7120f7f [diff] [blame] |
Add usage note
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 68a6c83..d1d1188 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst
@@ -496,6 +496,11 @@ 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)