Skip to content

Commit 47abbd1

Browse files
Apply suggestions from code review
Co-authored-by: Sergey B Kirpichev <[email protected]>
1 parent b7617c8 commit 47abbd1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Doc/library/functools.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ The :mod:`functools` module defines the following functions:
480480

481481
See :func:`itertools.accumulate` for an iterator that yields all intermediate
482482
values.
483+
483484
.. versionchanged:: 3.14
484485
*initial* is now supported as a keyword argument.
485486

Modules/_functoolsmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,8 @@ functools_reduce(PyObject *self, PyObject *args, PyObject *kwargs)
941941
static char *keywords[] = {"", "", "initial", NULL};
942942

943943
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|O:reduce", keywords,
944-
&func, &seq, &result)) {
944+
&func, &seq, &result))
945+
{
945946
return NULL;
946947
}
947948

@@ -1724,7 +1725,7 @@ PyDoc_STRVAR(_functools_doc,
17241725
"Tools that operate on functions.");
17251726

17261727
static PyMethodDef _functools_methods[] = {
1727-
{"reduce", functools_reduce, METH_VARARGS|METH_KEYWORDS,
1728+
{"reduce", _PyCFunction_CAST(functools_reduce), METH_VARARGS|METH_KEYWORDS,
17281729
functools_reduce_doc},
17291730
_FUNCTOOLS_CMP_TO_KEY_METHODDEF
17301731
{NULL, NULL} /* sentinel */

0 commit comments

Comments
 (0)