summaryrefslogtreecommitdiffstats
path: root/Doc/tut
diff options
context:
space:
mode:
authorAlex Martelli <aleaxit@gmail.com>2003-04-22 08:12:33 (GMT)
committerAlex Martelli <aleaxit@gmail.com>2003-04-22 08:12:33 (GMT)
commita70b19147fd163744be34745d393af7be603629f (patch)
tree8ec1a2ae14cfae5fb3a3f14af05a9c9f60b3d739 /Doc/tut
parent060641d51160f6bf49a049bb677f8412b5a19de3 (diff)
downloadcpython-a70b19147fd163744be34745d393af7be603629f.zip
cpython-a70b19147fd163744be34745d393af7be603629f.tar.gz
cpython-a70b19147fd163744be34745d393af7be603629f.tar.bz2
Adding new built-in function sum, with docs and tests.
Diffstat (limited to 'Doc/tut')
-rw-r--r--Doc/tut/tut.tex5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index 71d3f60..b227576 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -1819,6 +1819,9 @@ item, then to the result and the next item, and so on. For example,
0
\end{verbatim}
+Don't use this example's definition of \code{sum}: since summing numbers
+is such a common need, a built-in function \code{sum(\var{sequence})} is
+already provided, and works exactly like this\versionadded{2,3}.
\subsection{List Comprehensions}
@@ -2502,7 +2505,7 @@ standard module \module{__builtin__}\refbimodindex{__builtin__}:
'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'min',
'object', 'oct', 'open', 'ord', 'pow', 'property', 'quit',
'range', 'raw_input', 'reduce', 'reload', 'repr', 'round',
- 'setattr', 'slice', 'staticmethod', 'str', 'string', 'super',
+ 'setattr', 'slice', 'staticmethod', 'str', 'string', 'sum', 'super',
'tuple', 'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip']
\end{verbatim}