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 narrowing of IntEnum and StrEnum types #17874

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 4, 2024

Fix regression introduced in #17866. It should still be possible to narrow IntEnum and StrEnum types, but only when types match or are disjoint. Add more logic to rule out narrowing when types are ambigous.

Fix regression in #17866. It should still be possible to narrow
IntEnum and StrEnum types, but only when types match or are
disjoint. Add more logic to rule out narrowing when types are
ambigous.
Copy link
Contributor

github-actions bot commented Oct 4, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

optuna (https://github.com/optuna/optuna)
- tests/storages_tests/test_heartbeat.py:72: error: Unused "type: ignore" comment  [unused-ignore]
- tests/storages_tests/test_heartbeat.py:229: error: Unused "type: ignore" comment  [unused-ignore]

psycopg (https://github.com/psycopg/psycopg)
- tests/test_pipeline_async.py:57: error: Unused "type: ignore" comment  [unused-ignore]
- tests/test_pipeline.py:60: error: Unused "type: ignore" comment  [unused-ignore]

@JukkaL JukkaL merged commit 9330193 into master Oct 4, 2024
18 of 19 checks passed
@JukkaL JukkaL deleted the fix-int-enum-narrow branch October 4, 2024 11:52
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.

2 participants