summaryrefslogtreecommitdiffstats
path: root/Objects/enumobject.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2003-04-21 20:26:25 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2003-04-21 20:26:25 (GMT)
commitfbbe34789e62725cac074a188826e53d8cc95e16 (patch)
treec8b112f9928b2e356125ae9304a8e1083aad4067 /Objects/enumobject.c
parent631e87fb3d6e86d22dc9ed47773665d95d0e3ece (diff)
downloadcpython-fbbe34789e62725cac074a188826e53d8cc95e16.zip
cpython-fbbe34789e62725cac074a188826e53d8cc95e16.tar.gz
cpython-fbbe34789e62725cac074a188826e53d8cc95e16.tar.bz2
Add a useful docstring to enumerate.
Diffstat (limited to 'Objects/enumobject.c')
-rw-r--r--Objects/enumobject.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index c7e4365..66ee870 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -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)