mirror of
https://github.com/python/cpython.git
synced 2025-09-03 23:41:18 +00:00
bpo-37134: Use PEP570 syntax for sum() (GH-13851)
(cherry picked from commit c4c421d619
)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
21ce2454de
commit
23f41a64ea
1 changed files with 3 additions and 3 deletions
|
@ -1562,11 +1562,11 @@ are always available. They are listed here in alphabetical order.
|
||||||
about strings, see :ref:`textseq`.
|
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
|
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,
|
total. The *iterable*'s items are normally numbers, and the start value is not
|
||||||
and the start value is not allowed to be a string.
|
allowed to be a string.
|
||||||
|
|
||||||
For some use cases, there are good alternatives to :func:`sum`.
|
For some use cases, there are good alternatives to :func:`sum`.
|
||||||
The preferred, fast way to concatenate a sequence of strings is by calling
|
The preferred, fast way to concatenate a sequence of strings is by calling
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue