-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Better support for SomeEnum.item == some_literal
#19594
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
base: master
Are you sure you want to change the base?
Better support for SomeEnum.item == some_literal
#19594
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit confused about this in the original issue too
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried my listed use case against current mypy, which was wrong: #19753
This looks good to me though
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Fixes #19576.
Fixes #16327.
Fixes #17162.
Fixes #19753.
This needs more feedback: is the logic I propose reasonable? Do we want to be stricter and reject such comparisons altogether? Or maybe only reject them if values are incompatible?