diff options
Diffstat (limited to 'Doc/lib/libfuncs.tex')
-rw-r--r-- | Doc/lib/libfuncs.tex | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 5526dc5..1aa59dc 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -717,12 +717,12 @@ def my_import(name): \begin{funcdesc}{reduce}{function, sequence\optional{, initializer}} 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 \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. + 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 + \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 + \var{sequence} contains only one item, the first item is returned. \end{funcdesc} \begin{funcdesc}{reload}{module} |