summaryrefslogtreecommitdiffstats
path: root/Grammar/python.gram
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-11-16 23:08:35 (GMT)
committerGitHub <noreply@github.com>2020-11-16 23:08:35 (GMT)
commitcb3e5ed0716114393696ec7201e51fe0595eab4f (patch)
treef44ee133ea7d7ad30dec484eaa063ef6fc70ade9 /Grammar/python.gram
parentf62dad16b8e540486a0a0fed41e723d36986f860 (diff)
downloadcpython-cb3e5ed0716114393696ec7201e51fe0595eab4f.zip
cpython-cb3e5ed0716114393696ec7201e51fe0595eab4f.tar.gz
cpython-cb3e5ed0716114393696ec7201e51fe0595eab4f.tar.bz2
bpo-42374: Allow unparenthesized walrus in genexps (GH-23319)
This fixes a regression that was introduced by the new parser. Automerge-Triggered-By: GH:lysnikolaou
Diffstat (limited to 'Grammar/python.gram')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index ae5e4b5..91ce520 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -517,7 +517,7 @@ group[expr_ty]:
| '(' a=(yield_expr | named_expression) ')' { a }
| invalid_group
genexp[expr_ty]:
- | '(' a=expression ~ b=for_if_clauses ')' { _Py_GeneratorExp(a, b, EXTRA) }
+ | '(' a=named_expression ~ b=for_if_clauses ')' { _Py_GeneratorExp(a, b, EXTRA) }
| invalid_comprehension
set[expr_ty]: '{' a=expressions_list '}' { _Py_Set(a, EXTRA) }
setcomp[expr_ty]: