Skip to content

Comments

Support as-expressions on dict items#2686

Merged
ichard26 merged 1 commit intopsf:mainfrom
isidentical:support-as-expr-on-dict
Dec 12, 2021
Merged

Support as-expressions on dict items#2686
ichard26 merged 1 commit intopsf:mainfrom
isidentical:support-as-expr-on-dict

Conversation

@isidentical
Copy link
Collaborator

Fixes #2685

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
@ichard26
Copy link
Collaborator

Thank you @isidentical!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As expressions on case statements are broken inside dicts

3 participants