aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-11-17 01:09:35 +0200
committerGitHub <noreply@github.com>2020-11-17 01:09:35 +0200
commitcae60187cf7a7b26281d012e1952fafe4e2e97e9 (patch)
tree90fe6ee32f7e1df5f6bda8701d7bf5f434f4f382 /Grammar
parentbpo-42374: Allow unparenthesized walrus in genexps (GH-23319) (diff)
downloadcpython-cae60187cf7a7b26281d012e1952fafe4e2e97e9.tar.gz
cpython-cae60187cf7a7b26281d012e1952fafe4e2e97e9.tar.bz2
cpython-cae60187cf7a7b26281d012e1952fafe4e2e97e9.zip
bpo-42316: Allow unparenthesized walrus operator in indexes (GH-23317)
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 91ce520be1..a0e9a89ab9 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -491,7 +491,7 @@ slices[expr_ty]:
| a[asdl_expr_seq*]=','.slice+ [','] { _Py_Tuple(a, Load, EXTRA) }
slice[expr_ty]:
| a=[expression] ':' b=[expression] c=[':' d=[expression] { d }] { _Py_Slice(a, b, c, EXTRA) }
- | a=expression { a }
+ | a=named_expression { a }
atom[expr_ty]:
| NAME
| 'True' { _Py_Constant(Py_True, NULL, EXTRA) }