Skip to content

In examples, "except:" should use new syntax #60545

Closed

Description

@jcea
BPO 16341
Nosy @rhettinger, @jcea, @ezio-melotti, @merwok, @asvetlov
Files
  • issue16341.diff
  • 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 = None
    closed_at = <Date 2012-10-30.19:57:23.005>
    created_at = <Date 2012-10-28.01:58:40.528>
    labels = ['easy', 'type-feature', 'docs']
    title = 'In examples, "except:" should use new syntax'
    updated_at = <Date 2012-10-30.19:57:23.004>
    user = 'https://github.com/jcea'

    bugs.python.org fields:

    activity = <Date 2012-10-30.19:57:23.004>
    actor = 'asvetlov'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2012-10-30.19:57:23.005>
    closer = 'asvetlov'
    components = ['Documentation']
    creation = <Date 2012-10-28.01:58:40.528>
    creator = 'jcea'
    dependencies = []
    files = ['27763']
    hgrepos = []
    issue_num = 16341
    keywords = ['patch', 'easy']
    message_count = 5.0
    messages = ['173988', '174029', '174075', '174078', '174221']
    nosy_count = 8.0
    nosy_names = ['rhettinger', 'jcea', 'ezio.melotti', 'eric.araujo', 'cvrebert', 'asvetlov', 'docs@python', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16341'
    versions = ['Python 2.7']

    Activity

    1. jcea commented on Oct 28, 2012

      @jcea
      MemberAuthor

      In python 2.7 documentation, doing "grep -i 'except.*,.*:' *rst" shows quite a few "old style" "except:". I think that "except X, e:" should be transformed to "except X as e:", for clarity, as done in issue bpo-16332.

      The only thing is that this syntax, used in examples, would be incompatible with old python releases.

      Opinions?

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      docsDocumentation in the Doc dir
      and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on Oct 28, 2012
    3. asvetlov commented on Oct 28, 2012

      @asvetlov
      Contributor

      +1.
      Patch for 2.7 is attached.

    4. merwok commented on Oct 28, 2012

      @merwok
      Member

      I’m of two minds about this. On one hand this syntax avoids silent bugs and is compatible with 3.x, on the other hand if people use the 2.7 docs and use Python 2.4 or 2.5 the examples won’t work. Raymond, what’s your opinion?

    5. ezio-melotti commented on Oct 28, 2012

      @ezio-melotti
      Member

      The patch LGTM, and there are only 21 changes.

    6. python-dev commented on Oct 30, 2012

      python-devmannequin
      Mannequin

      New changeset 4e9617d3c514 by Andrew Svetlov in branch '2.7':
      Issue bpo-16341: convert examples to use except ... as ... syntax.
      http://hg.python.org/cpython/rev/4e9617d3c514

    7. 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

    No one assigned

      Labels

      docsDocumentation in the Doc direasytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions