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

PEP 614: Relaxing Grammar Restrictions On Decorators #83883

Closed
brandtbucher opened this issue Feb 20, 2020 · 8 comments
Closed

PEP 614: Relaxing Grammar Restrictions On Decorators #83883

brandtbucher opened this issue Feb 20, 2020 · 8 comments
Assignees
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@brandtbucher
Copy link
Member

BPO 39702
Nosy @gvanrossum, @miss-islington, @brandtbucher, @gousaiyang, @shankarj67
PRs
  • bpo-39702: Relax grammar restrictions on decorators (PEP 614). #18570
  • bpo-39702: Update the Language Reference (PEP 614). #18802
  • bpo-39868: Add the documentation for Assignment Expressions (PEP 572). #18851
  • bpo-39702: Remove dotted_name from decorator documentation #25234
  • [3.9] bpo-39702: Remove dotted_name from decorator documentation (GH-25234) #25290
  • 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/brandtbucher'
    closed_at = <Date 2020-03-07.19:13:10.129>
    created_at = <Date 2020-02-20.16:12:25.133>
    labels = ['interpreter-core', 'type-feature', '3.9']
    title = 'PEP 614: Relaxing Grammar Restrictions On Decorators'
    updated_at = <Date 2021-04-08.23:04:03.217>
    user = 'https://github.com/brandtbucher'

    bugs.python.org fields:

    activity = <Date 2021-04-08.23:04:03.217>
    actor = 'miss-islington'
    assignee = 'brandtbucher'
    closed = True
    closed_date = <Date 2020-03-07.19:13:10.129>
    closer = 'brandtbucher'
    components = ['Interpreter Core']
    creation = <Date 2020-02-20.16:12:25.133>
    creator = 'brandtbucher'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39702
    keywords = ['patch']
    message_count = 8.0
    messages = ['362328', '363311', '363312', '363319', '363324', '363612', '390568', '390570']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'miss-islington', 'brandtbucher', 'gousaiyang', 'shankarj67']
    pr_nums = ['18570', '18802', '18851', '25234', '25290']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue39702'
    versions = ['Python 3.9']

    @brandtbucher
    Copy link
    Member Author

    The attached PR implements PEP-614's revised grammar for decorators, with tests. In short:

    decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE

    becomes

    decorator: '@' namedexpr_test NEWLINE

    I'm marking it as DO-NOT-MERGE until the PEP is accepted, but code review is still appreciated. Discussion of the PEP itself should go to the Python-Dev thread:

    https://mail.python.org/archives/list/python-dev@python.org/thread/SLKFAR56RA6A533O5ZOZ7XTJ764EMB7I

    @brandtbucher brandtbucher added the 3.9 only security fixes label Feb 20, 2020
    @brandtbucher brandtbucher self-assigned this Feb 20, 2020
    @brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement 3.9 only security fixes labels Feb 20, 2020
    @brandtbucher brandtbucher self-assigned this Feb 20, 2020
    @brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Feb 20, 2020
    @gvanrossum
    Copy link
    Member

    New changeset be501ca by Brandt Bucher in branch 'master':
    bpo-39702: Relax grammar restrictions on decorators (PEP-614) (GH-18570)
    be501ca

    @gvanrossum
    Copy link
    Member

    I'm guessing there's some doc update that needs to happen now the code has landed.

    @brandtbucher
    Copy link
    Member Author

    Agreed. I'll have something up later, hopefully.

    I'll add a tiny blurb to whatsnew, as well as adding the PEP to the "See also:" note in https://docs.python.org/3.9/reference/compound_stmts.html and updating the mini-grammar there. I don't think it needs much else.

    Hmmm. It looks like the page of the docs that I've linked above wasn't ever updated for the walrus. We should probably add updating this part of the docs to https://devguide.python.org/grammar/...

    @gvanrossum
    Copy link
    Member

    Sounds good. If you feel like it you can submit a PR to the devguide, I'm sure Brett will merge it quickly...

    @gvanrossum
    Copy link
    Member

    New changeset 8f13053 by Brandt Bucher in branch 'master':
    bpo-39702: Update the Language Reference (PEP-614) (GH-18802)
    8f13053

    @brandtbucher
    Copy link
    Member Author

    New changeset 1e051a2 by Saiyang Gou in branch 'master':
    bpo-39702: Remove dotted_name from decorator documentation (GH-25234)
    1e051a2

    @miss-islington
    Copy link
    Contributor

    New changeset a9228d0 by Miss Islington (bot) in branch '3.9':
    [3.9] bpo-39702: Remove dotted_name from decorator documentation (GH-25234) (GH-25290)
    a9228d0

    @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
    3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants