[Python-3000-checkins] r63371 - in python/branches/py3k: Doc/library/functions.rst Objects/enumobject.c Python/bltinmodule.c

georg.brandl python-3000-checkins at python.org
Fri May 16 15:27:32 CEST 2008


Author: georg.brandl
Date: Fri May 16 15:27:32 2008
New Revision: 63371

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


Modified:
   python/branches/py3k/Doc/library/functions.rst
   python/branches/py3k/Objects/enumobject.c
   python/branches/py3k/Python/bltinmodule.c

Modified: python/branches/py3k/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k/Doc/library/functions.rst	(original)
+++ python/branches/py3k/Doc/library/functions.rst	Fri May 16 15:27:32 2008
@@ -325,9 +325,9 @@
    < 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
    :meth:`__next__` method of the iterator returned by :func:`enumerate` returns a
    tuple containing a count (from *start* which defaults to 0) and the

Modified: python/branches/py3k/Objects/enumobject.c
==============================================================================
--- python/branches/py3k/Objects/enumobject.c	(original)
+++ python/branches/py3k/Objects/enumobject.c	Fri May 16 15:27:32 2008
@@ -16,7 +16,7 @@
 	enumobject *en;
 	PyObject *seq = 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,
 					 &seq, &start))

Modified: python/branches/py3k/Python/bltinmodule.c
==============================================================================
--- python/branches/py3k/Python/bltinmodule.c	(original)
+++ python/branches/py3k/Python/bltinmodule.c	Fri May 16 15:27:32 2008
@@ -369,9 +369,9 @@
 }
 
 PyDoc_STRVAR(filter_doc,
-"filter(function or None, sequence) --> filter object\n\
+"filter(function or None, iterable) --> filter object\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.");
 
 PyTypeObject PyFilter_Type = {
@@ -1174,7 +1174,7 @@
 }
 
 PyDoc_STRVAR(iter_doc,
-"iter(collection) -> iterator\n\
+"iter(iterable) -> iterator\n\
 iter(callable, sentinel) -> iterator\n\
 \n\
 Get an iterator from an object.  In the first form, the argument must\n\
@@ -1942,10 +1942,10 @@
 }
 
 PyDoc_STRVAR(sum_doc,
-"sum(sequence[, start]) -> value\n\
+"sum(iterable[, start]) -> value\n\
 \n\
-Returns the sum of a sequence of numbers (NOT strings) plus the value\n\
-of parameter 'start' (which defaults to 0).  When the sequence is\n\
+Returns the sum of an iterable of numbers (NOT strings) plus the value\n\
+of parameter 'start' (which defaults to 0).  When the iterable is\n\
 empty, returns start.");
 
 


More information about the Python-3000-checkins mailing list