@@ -679,7 +679,7 @@ functools_reduce(PyObject *self, PyObject *args)
679
679
680
680
if (result == NULL )
681
681
PyErr_SetString (PyExc_TypeError ,
682
- "reduce() of empty sequence with no initial value" );
682
+ "reduce() of empty iterable with no initial value" );
683
683
684
684
Py_DECREF (it );
685
685
return result ;
@@ -692,14 +692,14 @@ functools_reduce(PyObject *self, PyObject *args)
692
692
}
693
693
694
694
PyDoc_STRVAR (functools_reduce_doc ,
695
- "reduce(function, sequence [, initial]) -> value\n\
695
+ "reduce(function, iterable [, initial]) -> value\n\
696
696
\n\
697
- Apply a function of two arguments cumulatively to the items of a sequence, \n\
698
- from left to right, so as to reduce the sequence to a single value. \n\
699
- For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n\
697
+ Apply a function of two arguments cumulatively to the items of a sequence\n\
698
+ or iterable, from left to right, so as to reduce the iterable to a single\n\
699
+ value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n\
700
700
((((1+2)+3)+4)+5). If initial is present, it is placed before the items\n\
701
- of the sequence in the calculation, and serves as a default when the\n\
702
- sequence is empty." );
701
+ of the iterable in the calculation, and serves as a default when the\n\
702
+ iterable is empty." );
703
703
704
704
/* lru_cache object **********************************************************/
705
705
0 commit comments