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 7 commits into
base: master
Choose a base branch
from

Conversation

sterliakov
Copy link
Collaborator

@sterliakov sterliakov commented Jul 16, 2025

Fixes #19454.
Fixes #18203.
Fixes #12899 (one error remains, but it is correct).

This might not be the most disciplined approach, but it should match the general expectations. In essence, here I apply union expansion to upper bounds the same way it was applied to plain unions.

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

This comment has been minimized.

@sterliakov sterliakov marked this pull request as ready for review July 16, 2025 14:39

This comment has been minimized.

… have other places that create same-id copies of typevars

This comment has been minimized.

@sterliakov sterliakov marked this pull request as draft August 8, 2025 16:56
Copy link
Contributor

github-actions bot commented Aug 8, 2025

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 August 8, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant