[Python-checkins] r63170 - python/trunk/Doc/library/functions.rst
georg.brandl
python-checkins at python.org
Mon May 12 18:53:42 CEST 2008
Author: georg.brandl
Date: Mon May 12 18:53:42 2008
New Revision: 63170
Log:
Fix parameter name for enumerate().
Modified:
python/trunk/Doc/library/functions.rst
Modified: python/trunk/Doc/library/functions.rst
==============================================================================
--- python/trunk/Doc/library/functions.rst (original)
+++ python/trunk/Doc/library/functions.rst Mon May 12 18:53:42 2008
@@ -335,14 +335,15 @@
Using :func:`divmod` with complex numbers is deprecated.
-.. function:: enumerate(iterable)
+.. function:: enumerate(sequence)
- 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 zero) and
- the corresponding value obtained from iterating over *iterable*.
- :func:`enumerate` is useful for obtaining an indexed series: ``(0, seq[0])``,
- ``(1, seq[1])``, ``(2, seq[2])``, .... For example:
+ Return an enumerate object. *sequence* 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 zero) and the corresponding value obtained
+ from iterating over *iterable*. :func:`enumerate` is useful for obtaining an
+ indexed series: ``(0, seq[0])``, ``(1, seq[1])``, ``(2, seq[2])``, .... For
+ example:
>>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']):
... print i, season
More information about the Python-checkins
mailing list