mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
In the description of enumerate(), the indexing operators should not
be included in the \var. This produced weird results in general, but broke the GNU info conversion.
This commit is contained in:
parent
7769bb9224
commit
3605ae5966
1 changed files with 2 additions and 2 deletions
|
@ -383,8 +383,8 @@ and implemented by Jack Jansen.}
|
||||||
A new built-in function, \function{enumerate()}, will make
|
A new built-in function, \function{enumerate()}, will make
|
||||||
certain loops a bit clearer. \code{enumerate(thing)}, where
|
certain loops a bit clearer. \code{enumerate(thing)}, where
|
||||||
\var{thing} is either an iterator or a sequence, returns a iterator
|
\var{thing} is either an iterator or a sequence, returns a iterator
|
||||||
that will return \code{(0, \var{thing[0]})}, \code{(1,
|
that will return \code{(0, \var{thing}[0])}, \code{(1,
|
||||||
\var{thing[1]})}, \code{(2, \var{thing[2]})}, and so forth.
|
\var{thing}[1])}, \code{(2, \var{thing}[2])}, and so forth.
|
||||||
|
|
||||||
Fairly often you'll see code to change every element of a list that
|
Fairly often you'll see code to change every element of a list that
|
||||||
looks like this:
|
looks like this:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue