Skip to content

Commit

Permalink
Add a useful docstring to enumerate.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyhylton committed Apr 21, 2003
1 parent 631e87f commit fbbe347
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Objects/enumobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fbbe347

Please sign in to comment.