Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support as-expressions on dict items #2686

merged 1 commit into from Dec 12, 2021


Copy link

Fixes #2685

@@ -168,8 +168,8 @@ subscript: test [':=' test] | [test] ':' [test] [sliceop]
sliceop: ':' [test]
exprlist: (expr|star_expr) (',' (expr|star_expr))* [',']
testlist: test (',' test)* [',']
dictsetmaker: ( ((test ':' test | '**' expr)
(comp_for | (',' (test ':' test | '**' expr))* [','])) |
dictsetmaker: ( ((test ':' asexpr_test | '**' expr)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asexpr_test is simply test ['as' test], so I do not anticipate any behavior change on regular dicts.

@ichard26 ichard26 merged commit 1c6b3a3 into psf:main Dec 12, 2021
Copy link

Thank you @isidentical!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

As expressions on case statements are broken inside dicts
3 participants