Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jcea opened this issue Oct 28, 2012 · 5 comments
Closed

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

jcea opened this issue Oct 28, 2012 · 5 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@jcea
Copy link
Member

jcea commented Oct 28, 2012

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']

    @jcea
    Copy link
    Member Author

    jcea commented Oct 28, 2012

    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?

    @jcea jcea added easy stdlib Python modules in the Lib dir docs Documentation in the Doc dir and removed stdlib Python modules in the Lib dir labels Oct 28, 2012
    @asvetlov
    Copy link
    Contributor

    +1.
    Patch for 2.7 is attached.

    @merwok
    Copy link
    Member

    merwok commented Oct 28, 2012

    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?

    @ezio-melotti
    Copy link
    Member

    The patch LGTM, and there are only 21 changes.

    @ezio-melotti ezio-melotti added the type-feature A feature request or enhancement label Oct 28, 2012
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 30, 2012

    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir easy type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants