diff options
| author | Zackery Spytz <zspytz@gmail.com> | 2020-06-28 00:40:54 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-28 15:40:54 +0900 |
| commit | cd3c2bdd5d53db7fe1d546543d32000070916552 (patch) | |
| tree | d819bf1020055af6da2e3ab84a97bb6d36d9eeb0 /Modules/_functoolsmodule.c | |
| parent | 8ab77c6f9fb6ef86af8f6b8722a2fcb37438edd0 (diff) | |
| download | cpython-git-cd3c2bdd5d53db7fe1d546543d32000070916552.tar.gz | |
bpo-31082: Use "iterable" in the docstring for functools.reduce() (GH-20796)
Diffstat (limited to 'Modules/_functoolsmodule.c')
| -rw-r--r-- | Modules/_functoolsmodule.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 8120140afa..bb86fe862d 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -679,7 +679,7 @@ functools_reduce(PyObject *self, PyObject *args) if (result == NULL) PyErr_SetString(PyExc_TypeError, - "reduce() of empty sequence with no initial value"); + "reduce() of empty iterable with no initial value"); Py_DECREF(it); return result; @@ -692,14 +692,14 @@ Fail: } PyDoc_STRVAR(functools_reduce_doc, -"reduce(function, sequence[, initial]) -> value\n\ +"reduce(function, iterable[, initial]) -> value\n\ \n\ -Apply a function of two arguments cumulatively to the items of a sequence,\n\ -from left to right, so as to reduce the sequence to a single value.\n\ -For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n\ +Apply a function of two arguments cumulatively to the items of a sequence\n\ +or iterable, from left to right, so as to reduce the iterable to a single\n\ +value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n\ ((((1+2)+3)+4)+5). If initial is present, it is placed before the items\n\ -of the sequence in the calculation, and serves as a default when the\n\ -sequence is empty."); +of the iterable in the calculation, and serves as a default when the\n\ +iterable is empty."); /* lru_cache object **********************************************************/ |
