Skip to content

bpo-39890: Don't mangle the AST when compiling starred assignments #18833

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

Merged
merged 4 commits into from
Mar 8, 2020

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Mar 7, 2020

It looks like assignment_helper is the only place where we actually change the semantic meaning of the AST during compilation (a starred name is changed to a regular name as a shortcut).

This probably isn't a great idea, and it would bite us later if we started making multiple passes or reusing the AST or something.

https://bugs.python.org/issue39890

@brandtbucher brandtbucher added the type-feature A feature request or enhancement label Mar 7, 2020
Copy link
Member

@isidentical isidentical left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1 @@
Don't mutate the AST when compiling starred assignments.
Copy link
Member

Choose a reason for hiding this comment

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

This is an internal change without user impact so we don't need NEWS entry for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! @pablogsal

Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank you very much!

@pablogsal pablogsal merged commit d5aa2e9 into python:master Mar 8, 2020
@brandtbucher brandtbucher deleted the preserve-ast branch July 21, 2022 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants