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

Skip to content

Commit b373799

Browse files
committed
Issue 7447: Improve docs for sum().
1 parent 87298c4 commit b373799

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
@@ -1115,10 +1115,13 @@ are always available. They are listed here in alphabetical order.
11151115

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

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

11231126
.. function:: super([type[, object-or-type]])
11241127

0 commit comments

Comments
 (0)