]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a useful docstring to enumerate.
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 21 Apr 2003 20:26:25 +0000 (20:26 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 21 Apr 2003 20:26:25 +0000 (20:26 +0000)
Objects/enumobject.c

index c7e4365676b93db920d266214bf320e649de3385..66ee870d469fae980989f87eee34e46e8b988470 100644 (file)
@@ -79,7 +79,12 @@ enum_next(enumobject *en)
 }
 
 PyDoc_STRVAR(enum_doc,
-"enumerate(iterable) -> create an enumerating-iterator");
+"enumerate(iterable) -> iterator for index, value of iterable\n"
+"\n"
+"Return an enumerate object.  iterable must be an other object that supports\n"
+"iteration.  The enumerate object yields pairs containing a count (from\n"
+"zero) and a value yielded by the iterable argument.  enumerate is useful\n"
+"for obtaining an indexed list: (0, seq[0]), (1, seq[1]), (2, seq[2]), ...");
 
 PyTypeObject PyEnum_Type = {
        PyObject_HEAD_INIT(&PyType_Type)