Closed
Labels
3.7 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement
Description
| BPO | 37196 |
|---|---|
| Nosy | @mwhudson, @rhettinger, @etrepum, @tiran, @jimfulton, @maggyero, @brandtbucher |
| Superseder |
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 2020-02-20.16:20:23.015>
created_at = <Date 2019-06-07.14:05:15.545>
labels = ['interpreter-core', 'type-feature', '3.7']
title = 'Allowing arbitrary expressions in the @expression syntax'
updated_at = <Date 2020-02-20.16:20:23.014>
user = 'https://github.com/maggyero'bugs.python.org fields:
activity = <Date 2020-02-20.16:20:23.014>
actor = 'brandtbucher'
assignee = 'none'
closed = True
closed_date = <Date 2020-02-20.16:20:23.015>
closer = 'brandtbucher'
components = ['Interpreter Core']
creation = <Date 2019-06-07.14:05:15.545>
creator = 'maggyero'
dependencies = []
files = []
hgrepos = []
issue_num = 37196
keywords = []
message_count = 5.0
messages = ['344939', '344940', '344944', '344946', '344952']
nosy_count = 8.0
nosy_names = ['mwh', 'rhettinger', 'bob.ippolito', 'exarkun', 'christian.heimes', 'j1m', 'maggyero', 'brandtbucher']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = 'resolved'
status = 'closed'
superseder = '39702'
type = 'enhancement'
url = 'https://bugs.python.org/issue37196'
versions = ['Python 3.7']Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement
Activity
maggyero commentedon Jun 7, 2019
Could we allow arbitrary expressions in the @expression syntax for applying decorators to functions/classes? The current grammar restriction to:
is very surprising and I don't understand the real motivation.
I find it weird that you are not able to do that:
since you get:
but the following is perfectly valid:
See this post for more details: https://stackoverflow.com/questions/56490579
tiran commentedon Jun 7, 2019
The syntax is deliberately limited. The reasons are explained at:
https://www.python.org/dev/peps/pep-0318/#current-syntax
https://mail.python.org/pipermail/python-dev/2004-August/046711.html
maggyero commentedon Jun 7, 2019
@christian Heimes
Yes I read that. But I am wondering if after 15 years Guido still has this "gut feeling". Because my gut feeling as a Python *user* who has discovered decorators and stumbled on this restriction was: "what?!".
gvanrossum commentedon Jun 7, 2019
What you want to write is as unreadable as it ever was.
maggyero commentedon Jun 7, 2019
@guido van Rossum
How is @g(f()()) more readable than @f()()? Yet the former is allowed.