Skip to content

Syntax error in sample code for enumerate in documentation. #48953

Closed

Description

@trenholmes
BPO 4703
Nosy @birkenfeld, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2008-12-20.03:20:37.064>
created_at = <Date 2008-12-20.03:08:09.462>
labels = ['docs']
title = 'Syntax error in sample code for enumerate in documentation.'
updated_at = <Date 2008-12-20.03:20:37.019>
user = 'https://bugs.python.org/trenholmes'

bugs.python.org fields:

activity = <Date 2008-12-20.03:20:37.019>
actor = 'benjamin.peterson'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-12-20.03:20:37.064>
closer = 'benjamin.peterson'
components = ['Documentation']
creation = <Date 2008-12-20.03:08:09.462>
creator = 'trenholmes'
dependencies = []
files = []
hgrepos = []
issue_num = 4703
keywords = []
message_count = 2.0
messages = ['78082', '78083']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'benjamin.peterson', 'trenholmes']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4703'
versions = ['Python 3.0']

Activity

  1. trenholmes commented on Dec 20, 2008

    trenholmesmannequin
    MannequinAuthor

    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

  2. added
    docs
    on Dec 20, 2008
  3. benjaminp commented on Dec 20, 2008

    @benjaminp
    Contributor

    Thanks for the report! Fixed in r67865.

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docs

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions