diff options
author | Raymond Hettinger <python@rcn.com> | 2010-10-31 21:28:53 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-10-31 21:28:53 (GMT) |
commit | 15c2cec4fd771b07f0b33c13979669c1230bc3c0 (patch) | |
tree | 8323176e30deccb8b2d04908b4dbb91a1b616897 /Doc/library/functions.rst | |
parent | 490986308e62c9eab8e521007849524c481160fc (diff) | |
download | cpython-15c2cec4fd771b07f0b33c13979669c1230bc3c0.zip cpython-15c2cec4fd771b07f0b33c13979669c1230bc3c0.tar.gz cpython-15c2cec4fd771b07f0b33c13979669c1230bc3c0.tar.bz2 |
Issue 7447: Improve docs for sum().
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 3b18c9a..ef913bf 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1227,10 +1227,13 @@ available. They are listed here in alphabetical order. Sums *start* and the items of an *iterable* from left to right and returns the total. *start* defaults to ``0``. The *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 ``''.join(sequence)``. Note that - ``sum(range(n), m)`` is equivalent to ``reduce(operator.add, range(n), m)`` - To add floating point values with extended precision, see :func:`math.fsum`\. + and the start value is not allowed to be a string. + + For some use cases, there a good alternatives to :func:`sum`. + The preferred, fast way to concatenate a sequence of strings is by calling + ``''.join(sequence)``. To add floating point values with extended precision, + see :func:`math.fsum`\. To concatenate a series of iterables, consider using + :func:`itertools.chain`. .. versionadded:: 2.3 |