summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-11-16 23:38:58 (GMT)
committerGitHub <noreply@github.com>2020-11-16 23:38:58 (GMT)
commit2b800ef809eefbc96a536e4b43a8285f2353f64d (patch)
treea7324a40ab4f2e34a8581fd670554dde2688ada4 /Grammar
parentcf70854f10096446115408b5a94030b30594a459 (diff)
downloadcpython-2b800ef809eefbc96a536e4b43a8285f2353f64d.zip
cpython-2b800ef809eefbc96a536e4b43a8285f2353f64d.tar.gz
cpython-2b800ef809eefbc96a536e4b43a8285f2353f64d.tar.bz2
bpo-42374: Allow unparenthesized walrus in genexps (GH-23319) (GH-23329)
This fixes a regression that was introduced by the new parser. (cherry picked from commit cb3e5ed0716114393696ec7201e51fe0595eab4f)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 60eeb36..257d2f5 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -503,7 +503,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]: