diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-12-20 19:57:10 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-12-20 19:57:10 (GMT) |
commit | 1be2ac9cd6e72dd5116a24d173b66f9ae4ec51f0 (patch) | |
tree | 334a548ada9ae1d07bb113eeb00afb07d4fee3f8 | |
parent | eca4c31267526dffe471bc78712dd884c4f04c34 (diff) | |
download | cpython-1be2ac9cd6e72dd5116a24d173b66f9ae4ec51f0.zip cpython-1be2ac9cd6e72dd5116a24d173b66f9ae4ec51f0.tar.gz cpython-1be2ac9cd6e72dd5116a24d173b66f9ae4ec51f0.tar.bz2 |
[Bug #1619674] Make sum() use the term iterable, not sequence
-rw-r--r-- | Doc/lib/libfuncs.tex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index dc52915..4f41002 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -1087,11 +1087,11 @@ class C: string, \code{''}. \end{funcdesc} -\begin{funcdesc}{sum}{sequence\optional{, start}} - Sums \var{start} and the items of a \var{sequence}, from left to - right, and returns the total. \var{start} defaults to \code{0}. - The \var{sequence}'s items are normally numbers, and are not allowed - to be strings. The fast, correct way to concatenate sequence of +\begin{funcdesc}{sum}{iterable\optional{, start}} + Sums \var{start} and the items of an \var{iterable} from left to + right and returns the total. \var{start} defaults to \code{0}. + The \var{iterable}'s items are normally numbers, and are not allowed + to be strings. The fast, correct way to concatenate a sequence of strings is by calling \code{''.join(\var{sequence})}. Note that \code{sum(range(\var{n}), \var{m})} is equivalent to \code{reduce(operator.add, range(\var{n}), \var{m})} |