summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-05 23:21:08 (GMT)
committerGitHub <noreply@github.com>2019-06-05 23:21:08 (GMT)
commit23f41a64ea668296fa89e25f3cfa11f63026ecac (patch)
tree034fcbe74fb9e21deb39ec75f8ed88c78d5e509e /Doc/library/functions.rst
parent21ce2454de57caaa532d11d76544632608f4b86b (diff)
downloadcpython-23f41a64ea668296fa89e25f3cfa11f63026ecac.zip
cpython-23f41a64ea668296fa89e25f3cfa11f63026ecac.tar.gz
cpython-23f41a64ea668296fa89e25f3cfa11f63026ecac.tar.bz2
bpo-37134: Use PEP570 syntax for sum() (GH-13851)
(cherry picked from commit c4c421d619baf2ff2f7e09f55b7ae22b8f863c7b) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Doc/library/functions.rst')
-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 415a65b..8897705 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