summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-10-13 17:52:35 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-10-13 17:52:35 (GMT)
commitc2a2832bee2d30119981d7924223823b3f099662 (patch)
treee928bec1015c5257788398c119c19111e4d21c18 /Doc
parent7decf5e5af035dd15b62aa5894c0c95657fae5ee (diff)
downloadcpython-c2a2832bee2d30119981d7924223823b3f099662.zip
cpython-c2a2832bee2d30119981d7924223823b3f099662.tar.gz
cpython-c2a2832bee2d30119981d7924223823b3f099662.tar.bz2
SF bug #821701: reduce docs neglect a very important piece of information.
Add a note showing which argument is the accumulator.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libfuncs.tex4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index 936a023..a9f3a65 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -816,7 +816,9 @@ class C(object):
Apply \var{function} of two arguments cumulatively to the items of
\var{sequence}, from left to right, so as to reduce the sequence to
a single value. For example, \code{reduce(lambda x, y: x+y, [1, 2,
- 3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}. If the optional
+ 3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}. The left argument,
+ \var{x}, is the accumulated value and the right argument, \var{y},
+ is the update value from the \var{sequence}. If the optional
\var{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 \var{initializer} is not given and