]> granicus.if.org Git - python/commitdiff
Issue 7447: Improve docs for sum().
authorRaymond Hettinger <python@rcn.com>
Sun, 31 Oct 2010 21:28:53 +0000 (21:28 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 31 Oct 2010 21:28:53 +0000 (21:28 +0000)
Doc/library/functions.rst

index 3b18c9a87b139e9b2baba69e31612a0edfab6822..ef913bfa2de49a61b97064eac634c295962682b2 100644 (file)
@@ -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