Use xrange in the example
This commit is contained in:
parent
9f55b63060
commit
6ab9813605
|
@ -593,7 +593,7 @@ loops that truncate the stream.
|
||||||
A common use for *repeat* is to supply a stream of constant values to *imap*
|
A common use for *repeat* is to supply a stream of constant values to *imap*
|
||||||
or *zip*::
|
or *zip*::
|
||||||
|
|
||||||
>>> list(imap(pow, range(10), repeat(2)))
|
>>> list(imap(pow, xrange(10), repeat(2)))
|
||||||
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
|
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
|
||||||
|
|
||||||
.. function:: starmap(function, iterable)
|
.. function:: starmap(function, iterable)
|
||||||
|
|
Loading…
Reference in New Issue