Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9df1002

Browse files
direvusrhettinger
authored andcommittedOct 1, 2018
Fix name of argument in docs for functools.reduce(). (python#9634)
1 parent 5fa247d commit 9df1002

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎Doc/library/functools.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,14 @@ The :mod:`functools` module defines the following functions:
280280

281281
.. function:: reduce(function, iterable[, initializer])
282282

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,
285285
``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates ``((((1+2)+3)+4)+5)``.
286286
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.
291291

292292
Roughly equivalent to::
293293

0 commit comments

Comments
 (0)
Please sign in to comment.