KEMBAR78
Fix narrowing of IntEnum and StrEnum types by JukkaL · Pull Request #17874 · python/mypy · GitHub
Skip to content

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.
@github-actions
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