diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-26 20:29:44 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-26 20:29:44 (GMT) |
commit | 38f71973e52f59e51c8676299f44f829408699ff (patch) | |
tree | 06ef5c6c9cf4537ccb47b0da3b20fe1822566bab /Doc/lib/libfuncs.tex | |
parent | 26dd830123413207ca816377bb934a15d2e1b215 (diff) | |
download | cpython-38f71973e52f59e51c8676299f44f829408699ff.zip cpython-38f71973e52f59e51c8676299f44f829408699ff.tar.gz cpython-38f71973e52f59e51c8676299f44f829408699ff.tar.bz2 |
Documentation for the enumerate() function/type.
This closes SF patch #547162.
Diffstat (limited to 'Doc/lib/libfuncs.tex')
-rw-r--r-- | Doc/lib/libfuncs.tex | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 3192a17..c7bb5a6 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -261,6 +261,18 @@ def my_import(name): \var{b}, and \code{0 <= abs(\var{a} \%{} \var{b}) < abs(\var{b})}. \end{funcdesc} +\begin{funcdesc}{enumerate}{iterable} + Return an enumerate object. \var{iterable} must be a sequence, an + iterator, or some other object which supports iteration. The + \method{next()} method of the iterator returned by + \function{enumerate()} returns a tuple containing a count (from + zero) and the corresponding value obtained from iterating over + \var{iterable}. \function{enumerate} is useful for obtaining an + indexed series: \code{(0, seq[0])}, \code{(1, seq[1])}, \code{(2, + seq[2])}, \ldots. + \versionadded{2.3} +\end{funcdesc} + \begin{funcdesc}{eval}{expression\optional{, globals\optional{, locals}}} The arguments are a string and two optional dictionaries. The \var{expression} argument is parsed and evaluated as a Python |