Skip to content

Conversation

@sterliakov
Copy link
Collaborator

Fixes #19996.

This was unearthed by #19400 where is_subtype(Partial<X>, Partial<X>) started returning True - before that binder.assign_type(expr, Partial<None>, Partial<None>) just returned early. If I understand correctly, that is how Partial should be handled here: we do not want to push partials to the binder. I do not think we should add a special case for that (both False and True make some sense for a partial type, I am not convinced that either one is marginally better), so I just add an explicit guard to skip adding partial types here.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

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

@sterliakov sterliakov requested a review from JukkaL November 8, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INTERNAL ERROR with allow_redefinition_new and undeclared instance variables

1 participant