This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Syntax error in sample code for enumerate in documentation.
Type: Stage:
Components: Documentation Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: benjamin.peterson, georg.brandl, trenholmes
Priority: normal Keywords:

Created on 2008-12-20 03:08 by trenholmes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg78082 - (view) Author: Roger (trenholmes) Date: 2008-12-20 03:08
Summary: Sample code for enumerate contains a syntax error. The same
code reads:

>>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter')]:
...     print(i, season)

Where the parenthesis and square bracket to the left of the colon in the
for line are backwards.  It should read:

>>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']):

Where: http://docs.python.org/dev/3.0/library/functions.html
msg78083 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-12-20 03:20
Thanks for the report! Fixed in r67865.
History
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 48953
2008-12-20 03:20:37benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg78083
nosy: + benjamin.peterson
2008-12-20 03:08:09trenholmescreate