@@ -280,14 +280,14 @@ The :mod:`functools` module defines the following functions:
280
280
281
281
.. function :: reduce(function, iterable[, initializer])
282
282
283
- Apply *function * of two arguments cumulatively to the items of *sequence *, from
284
- left to right, so as to reduce the sequence to a single value. For example,
283
+ Apply *function * of two arguments cumulatively to the items of *iterable *, from
284
+ left to right, so as to reduce the iterable to a single value. For example,
285
285
``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) `` calculates ``((((1+2)+3)+4)+5) ``.
286
286
The left argument, *x *, is the accumulated value and the right argument, *y *, is
287
- the update value from the *sequence *. If the optional *initializer * is present,
288
- it is placed before the items of the sequence in the calculation, and serves as
289
- a default when the sequence is empty. If *initializer * is not given and
290
- *sequence * contains only one item, the first item is returned.
287
+ the update value from the *iterable *. If the optional *initializer * is present,
288
+ it is placed before the items of the iterable in the calculation, and serves as
289
+ a default when the iterable is empty. If *initializer * is not given and
290
+ *iterable * contains only one item, the first item is returned.
291
291
292
292
Roughly equivalent to::
293
293
0 commit comments