Adding new built-in function sum, with docs and tests.

This commit is contained in:
Alex Martelli 2003-04-22 08:12:33 +00:00
parent 060641d511
commit a70b19147f
5 changed files with 98 additions and 1 deletions

View file

@ -897,6 +897,14 @@ class C:
\versionadded{2.2}
\end{funcdesc}
\begin{funcdesc}{sum}{sequence\optional{start=0}}
Sums up the items of a \var{sequence}, from left to right, and returns
the total. The \var{sequence}'s items are normally numbers, and are
not allowed to be strings. The fast, correct way to join up a
sequence of strings is by calling \code{''.join(\var{sequence})}.
\versionadded{2.3}
\end{funcdesc}
\begin{funcdesc}{super}{type\optional{object-or-type}}
Return the superclass of \var{type}. If the second argument is omitted
the super object returned is unbound. If the second argument is an