merge
This commit is contained in:
commit
590463efc4
|
@ -534,6 +534,11 @@ loops that truncate the stream.
|
||||||
for i in range(times):
|
for i in range(times):
|
||||||
yield object
|
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)
|
.. function:: starmap(function, iterable)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue