[Python-checkins] Fix name of argument in docs for functools.reduce(). (#9634)

Raymond Hettinger webhook-mailer at python.org
Mon Oct 1 02:52:17 EDT 2018


https://github.com/python/cpython/commit/9df100286b35f1f9fa85976d573981f558805b3f
commit: 9df100286b35f1f9fa85976d573981f558805b3f
branch: master
author: Brendan Jurd <direvus at gmail.com>
committer: Raymond Hettinger <rhettinger at users.noreply.github.com>
date: 2018-09-30T23:52:10-07:00
summary:

Fix name of argument in docs for functools.reduce(). (#9634)

files:
M Doc/library/functools.rst

diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 214d57334c8d..7d59ec9187df 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -280,14 +280,14 @@ The :mod:`functools` module defines the following functions:
 
 .. function:: reduce(function, iterable[, initializer])
 
-   Apply *function* of two arguments cumulatively to the items of *sequence*, from
-   left to right, so as to reduce the sequence to a single value.  For example,
+   Apply *function* of two arguments cumulatively to the items of *iterable*, from
+   left to right, so as to reduce the iterable to a single value.  For example,
    ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates ``((((1+2)+3)+4)+5)``.
    The left argument, *x*, is the accumulated value and the right argument, *y*, is
-   the update value from the *sequence*.  If the optional *initializer* is present,
-   it is placed before the items of the sequence in the calculation, and serves as
-   a default when the sequence is empty.  If *initializer* is not given and
-   *sequence* contains only one item, the first item is returned.
+   the update value from the *iterable*.  If the optional *initializer* is present,
+   it is placed before the items of the iterable in the calculation, and serves as
+   a default when the iterable is empty.  If *initializer* is not given and
+   *iterable* contains only one item, the first item is returned.
 
    Roughly equivalent to::
 



More information about the Python-checkins mailing list