FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Better support for `SomeEnum.item == some_literal` by sterliakov · Pull Request #19594 · python/mypy · GitHub

Repository navigation

Better support for SomeEnum.item == some_literal - #19594

Draft
sterliakov wants to merge 13 commits into
python:masterfrom
sterliakov:bugfix/gh-19576-enum-comparison-overlap
Draft

sterliakov wants to merge 13 commits into
python:masterfrom
sterliakov:bugfix/gh-19576-enum-comparison-overlap

Conversation

sterliakov commented Aug 4, 2025 •
edited
Loading

Copy link
Copy Markdown
Collaborator

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?

This comment has been minimized.

A5rocks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I was a bit confused about this in the original issue too

Comment thread test-data/unit/check-enum.test Outdated

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

sterliakov marked this pull request as ready for review August 28, 2025 13:51

A5rocks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I tried my listed use case against current mypy, which was wrong: #19753

This looks good to me though

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Copy Markdown
Collaborator Author

Draft until I can address #20142 (comment)

A5rocks commented Feb 15, 2026

Copy link
Copy Markdown
Collaborator

Probably this has to be recreated to work with new narrowing... and half of the listed issues are closed now!

(not really sure though, I completely forgot what this PR does :/)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants


Back | FazBrowse Home | New Git URL