[Python-checkins] bpo-37134: Use PEP570 syntax for sum() (GH-13851)

Pablo Galindo webhook-mailer at python.org
Wed Jun 5 19:11:50 EDT 2019


https://github.com/python/cpython/commit/c4c421d619baf2ff2f7e09f55b7ae22b8f863c7b
commit: c4c421d619baf2ff2f7e09f55b7ae22b8f863c7b
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-06-06T00:11:46+01:00
summary:

bpo-37134: Use PEP570 syntax for sum() (GH-13851)

files:
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 415a65b4946f..88977056723f 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



More information about the Python-checkins mailing list