Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9df10028
Commit
9df10028
authored
Oct 01, 2018
by
Brendan Jurd
Committed by
Raymond Hettinger
Sep 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix name of argument in docs for functools.reduce(). (#9634)
parent
5fa247d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Doc/library/functools.rst
Doc/library/functools.rst
+6
-6
No files found.
Doc/library/functools.rst
View file @
9df10028
...
...
@@ -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 *
sequenc
e*, from
left to right, so as to reduce the
sequenc
e to a single value. For example,
Apply *function* of two arguments cumulatively to the items of *
iterabl
e*, from
left to right, so as to reduce the
iterabl
e 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 *
sequenc
e*. If the optional *initializer* is present,
it is placed before the items of the
sequenc
e in the calculation, and serves as
a default when the
sequenc
e is empty. If *initializer* is not given and
*
sequenc
e* contains only one item, the first item is returned.
the update value from the *
iterabl
e*. If the optional *initializer* is present,
it is placed before the items of the
iterabl
e in the calculation, and serves as
a default when the
iterabl
e is empty. If *initializer* is not given and
*
iterabl
e* contains only one item, the first item is returned.
Roughly equivalent to::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment