bpo-42316: Allow unparenthesized walrus operator in indexes (GH-23317)

This commit is contained in:
Lysandros Nikolaou 2020-11-17 01:09:35 +02:00 committed by GitHub
parent cb3e5ed071
commit cae60187cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 7 deletions

View file

@ -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) }