Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30bf6e8

Browse files
committed
Issue 7447: Improve docs for sum().
1 parent af577cb commit 30bf6e8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Doc/library/functions.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,10 +1100,13 @@ are always available. They are listed here in alphabetical order.
11001100

11011101
Sums *start* and the items of an *iterable* from left to right and returns the
11021102
total. *start* defaults to ``0``. The *iterable*'s items are normally numbers,
1103-
and are not allowed to be strings. The fast, correct way to concatenate a
1104-
sequence of strings is by calling ``''.join(sequence)``. To add floating
1105-
point values with extended precision, see :func:`math.fsum`\.
1103+
and the start value is not allowed to be a string.
11061104

1105+
For some use cases, there a good alternatives to :func:`sum`.
1106+
The preferred, fast way to concatenate a sequence of strings is by calling
1107+
``''.join(sequence)``. To add floating point values with extended precision,
1108+
see :func:`math.fsum`\. To concatenate a series of iterables, consider using
1109+
:func:`itertools.chain`.
11071110

11081111
.. function:: super([type[, object-or-type]])
11091112

0 commit comments

Comments
 (0)