FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-37134: Use PEP570 syntax for sum() (GH-13851) · python/cpython@23f41a6 · GitHub

/ cpython Public

Commit 23f41a6

Browse files
bpo-37134: Use PEP570 syntax for sum() (GH-13851)
(cherry picked from commit c4c421d) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 parent 21ce245 commit 23f41a6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Doc/library/functions.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,11 +1562,11 @@ are always available. They are listed here in alphabetical order.
15621562
about strings, see :ref:`textseq`.
15631563

15641564

1565-
.. function:: sum(iterable[, start])
1565+
.. function:: sum(iterable, /, start=0)
15661566

15671567
Sums *start* and the items of an *iterable* from left to right and returns the
1568-
total. *start* defaults to ``0``. The *iterable*'s items are normally numbers,
1569-
and the start value is not allowed to be a string.
1568+
total. The *iterable*'s items are normally numbers, and the start value is not
1569+
allowed to be a string.
15701570

15711571
For some use cases, there are good alternatives to :func:`sum`.
15721572
The preferred, fast way to concatenate a sequence of strings is by calling

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL