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

Fix crash on star unpacking to underscore #14624

Merged
merged 6 commits into from
Feb 8, 2023

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Feb 6, 2023

Fixes #14250

This one is interesting. It looks like most likely this was caused by my PR #7127 that fixed other crash. After looking a bit more, StarType is something old, and should never by used. At least I didn't find visit_star_type() in any of the type visitors. Actually mypy already uses assert False, if we get to a non-special-cased star expression.

Btw, I noticed that pythoneval test with empty expected output passes in case of a crash (at least on my machine), so I fix this too.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Great! Can we clean up all the StarType code then?

@ilevkivskyi
Copy link
Member Author

Can we clean up all the StarType code then?

Hm, it looks like yes, there are no more places where new (not copies) StarTypes are created.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Very nice!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit 891e035 into python:master Feb 8, 2023
@ilevkivskyi ilevkivskyi deleted the fix-star-crahs branch February 8, 2023 17:16
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.

Crash on nested unpacking of next() call
2 participants