Skip to content

Apply union expansion when checking ops involving typevars #19455

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sterliakov
Copy link
Collaborator

Fixes #19454. This might not be the most disciplined approach, but it should match the general expectations.

@sterliakov sterliakov changed the title Apply union expansion when checking ops to typevars Apply union expansion when checking ops involving typevars Jul 16, 2025
Copy link
Contributor

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

@sterliakov sterliakov marked this pull request as ready for review July 16, 2025 14:39
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.

Comparison operators emit "Unsupported operand types" when using isinstance to narrow TypeVar to union of numeric types
1 participant