classification
Title: PEP 614: Relaxing Grammar Restrictions On Decorators
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: brandtbucher Nosy List: brandtbucher, gvanrossum, shankarj67
Priority: normal Keywords: patch

Created on 2020-02-20 16:12 by brandtbucher, last changed 2020-03-08 13:28 by shankarj67. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18570 merged brandtbucher, 2020-02-20 16:14
PR 18802 merged brandtbucher, 2020-03-06 07:07
PR 18851 merged shankarj67, 2020-03-08 13:28
Messages (6)
msg362328 - (view) Author: Brandt Bucher (brandtbucher) * (Python triager) Date: 2020-02-20 16:12
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
msg363311 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-03-03 22:25
New changeset be501ca2419a91546dea85ef4f36945545458589 by Brandt Bucher in branch 'master':
bpo-39702: Relax grammar restrictions on decorators (PEP 614) (GH-18570)
https://github.com/python/cpython/commit/be501ca2419a91546dea85ef4f36945545458589
msg363312 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-03-03 22:26
I'm guessing there's some doc update that needs to happen now the code has landed.
msg363319 - (view) Author: Brandt Bucher (brandtbucher) * (Python triager) Date: 2020-03-04 01:47
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/...
msg363324 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-03-04 04:17
Sounds good. If you feel like it you can submit a PR to the devguide, I'm sure Brett will merge it quickly...
msg363612 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-03-07 18:23
New changeset 8f130536926a30237b5297780d61ef4232e88577 by Brandt Bucher in branch 'master':
bpo-39702: Update the Language Reference (PEP 614) (GH-18802)
https://github.com/python/cpython/commit/8f130536926a30237b5297780d61ef4232e88577
History
Date User Action Args
2020-03-08 13:28:29shankarj67setnosy: + shankarj67

pull_requests: + pull_request18208
2020-03-07 19:13:10brandtbuchersetstatus: open -> closed
stage: patch review -> resolved
2020-03-07 18:23:52gvanrossumsetmessages: + msg363612
2020-03-06 07:07:23brandtbuchersetpull_requests: + pull_request18158
2020-03-04 04:17:54gvanrossumsetmessages: + msg363324
2020-03-04 01:47:04brandtbuchersetmessages: + msg363319
2020-03-03 22:26:50gvanrossumsetmessages: + msg363312
2020-03-03 22:25:51gvanrossumsetmessages: + msg363311
2020-02-20 16:20:55brandtbucherlinkissue19660 superseder
2020-02-20 16:20:23brandtbucherlinkissue37196 superseder
2020-02-20 16:14:09brandtbuchersetkeywords: + patch
stage: patch review
pull_requests: + pull_request17949
2020-02-20 16:12:25brandtbuchercreate