summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-06-06 00:11:46 +0100
committerGitHub <noreply@github.com>2019-06-06 00:11:46 +0100
commitc4c421d619baf2ff2f7e09f55b7ae22b8f863c7b (patch)
tree874731c20824d395586edb35ecb6705cd3fd539f
parente985804207473796a1326585b3e1b9e18c764345 (diff)
downloadcpython-git-c4c421d619baf2ff2f7e09f55b7ae22b8f863c7b.tar.gz
bpo-37134: Use PEP570 syntax for sum() (GH-13851)
-rw-r--r--Doc/library/functions.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 415a65b494..8897705672 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1562,11 +1562,11 @@ are always available. They are listed here in alphabetical order.
about strings, see :ref:`textseq`.
-.. function:: sum(iterable[, start])
+.. function:: sum(iterable, /, start=0)
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 the start value is not allowed to be a string.
+ total. The *iterable*'s items are normally numbers, and the start value is not
+ allowed to be a string.
For some use cases, there are good alternatives to :func:`sum`.
The preferred, fast way to concatenate a sequence of strings is by calling