KEMBAR78
Remove last unreachable block from mypyc code by sterliakov · Pull Request #19086 · python/mypy · GitHub
Skip to content

Conversation

@sterliakov
Copy link
Collaborator

@sterliakov sterliakov commented May 13, 2025

Supplements #19050. The old version did certainly contain unreachable code, as otherwise that branch would have crashed, there is no type_args attribute. This block was introduced in #17027 - probably as a future-proof expansion to generic primitive operations, but it makes no sense now, this logic can be added back should it become necessary. cc @JukkaL as the original author

Copy link
Collaborator

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

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

I actually ran into this when making mypy check unreachable code and replaced the unreachable branch with an assert False so I'm very sure this is right!

@sterliakov sterliakov added the topic-mypyc mypyc bugs label Jun 4, 2025
@JukkaL JukkaL merged commit b025bda into python:master Jun 5, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-mypyc mypyc bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants