Mercurial > cpython-lru_cache-weakref
diff Objects/enumobject.c @ 28711:820d9570edeb legacy-trunk
Add a useful docstring to enumerate.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Mon, 21 Apr 2003 20:26:25 +0000 |
| parents | fd5ef7003469 |
| children | 811ad5f2f701 |
line wrap: on
line diff
--- a/Objects/enumobject.c Mon Apr 21 14:33:04 2003 +0000 +++ b/Objects/enumobject.c Mon Apr 21 20:26:25 2003 +0000 @@ -79,7 +79,12 @@ } 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)
