bpo-34637: Make the *start* argument for *sum()* visible as a keyword argument. (GH-9208)

This commit is contained in:
Raymond Hettinger 2018-09-12 10:54:06 -07:00 committed by GitHub
parent 0fb9fadd3b
commit 9dfa0fe587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 8 deletions

View file

@ -2272,8 +2272,8 @@ With an argument, equivalent to object.__dict__.");
sum as builtin_sum
iterable: object
start: object(c_default="NULL") = 0
/
start: object(c_default="NULL") = 0
Return the sum of a 'start' value (default: 0) plus an iterable of numbers
@ -2284,7 +2284,7 @@ reject non-numeric types.
static PyObject *
builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
/*[clinic end generated code: output=df758cec7d1d302f input=3b5b7a9d7611c73a]*/
/*[clinic end generated code: output=df758cec7d1d302f input=162b50765250d222]*/
{
PyObject *result = start;
PyObject *temp, *item, *iter;