Rename enumerate() kw argument name to "iterable" and fix "sequence"->"iterable" in some docstrings.

This commit is contained in:
Georg Brandl 2008-05-16 13:27:32 +00:00
parent 1f2ba4b6da
commit d11ae5d6ec
3 changed files with 9 additions and 9 deletions

View File

@ -325,9 +325,9 @@ are always available. They are listed here in alphabetical order.
< abs(b)``. < abs(b)``.
.. function:: enumerate(sequence[, start=0]) .. function:: enumerate(iterable[, start=0])
Return an enumerate object. *sequence* must be a sequence, an Return an enumerate object. *iterable* must be a sequence, an
:term:`iterator`, or some other object which supports iteration. The :term:`iterator`, or some other object which supports iteration. The
:meth:`__next__` method of the iterator returned by :func:`enumerate` returns a :meth:`__next__` method of the iterator returned by :func:`enumerate` returns a
tuple containing a count (from *start* which defaults to 0) and the tuple containing a count (from *start* which defaults to 0) and the

View File

@ -16,7 +16,7 @@ enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
enumobject *en; enumobject *en;
PyObject *seq = NULL; PyObject *seq = NULL;
PyObject *start = NULL; PyObject *start = NULL;
static char *kwlist[] = {"sequence", "start", 0}; static char *kwlist[] = {"iterable", "start", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:enumerate", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:enumerate", kwlist,
&seq, &start)) &seq, &start))

View File

@ -369,9 +369,9 @@ filter_next(filterobject *lz)
} }
PyDoc_STRVAR(filter_doc, PyDoc_STRVAR(filter_doc,
"filter(function or None, sequence) --> filter object\n\ "filter(function or None, iterable) --> filter object\n\
\n\ \n\
Return an iterator yielding those items of sequence for which function(item)\n\ Return an iterator yielding those items of iterable for which function(item)\n\
is true. If function is None, return the items that are true."); is true. If function is None, return the items that are true.");
PyTypeObject PyFilter_Type = { PyTypeObject PyFilter_Type = {
@ -1174,7 +1174,7 @@ builtin_iter(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(iter_doc, PyDoc_STRVAR(iter_doc,
"iter(collection) -> iterator\n\ "iter(iterable) -> iterator\n\
iter(callable, sentinel) -> iterator\n\ iter(callable, sentinel) -> iterator\n\
\n\ \n\
Get an iterator from an object. In the first form, the argument must\n\ Get an iterator from an object. In the first form, the argument must\n\
@ -1942,10 +1942,10 @@ builtin_sum(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(sum_doc, PyDoc_STRVAR(sum_doc,
"sum(sequence[, start]) -> value\n\ "sum(iterable[, start]) -> value\n\
\n\ \n\
Returns the sum of a sequence of numbers (NOT strings) plus the value\n\ Returns the sum of an iterable of numbers (NOT strings) plus the value\n\
of parameter 'start' (which defaults to 0). When the sequence is\n\ of parameter 'start' (which defaults to 0). When the iterable is\n\
empty, returns start."); empty, returns start.");