Fix incorrect join in the presence of Any fallback - #14404
Merged
Conversation
hauntsaninja
marked this pull request as draft
January 6, 2023 05:27
hauntsaninja
force-pushed
the
any-join
branch
3 times, most recently
from
January 6, 2023 07:37
c6b34ae to
e10804b
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
|
cc @ilevkivskyi could you review? The check_context assertion comes from #13303 , as far as I can see no changes are required for |
hauntsaninja
marked this pull request as ready for review
January 9, 2023 06:22
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: kornia (https://github.com/kornia/kornia)
- kornia/nerf/nerf_model.py:121: error: "object" not callable [operator]
|
Member
|
I finally got some time to think about this. In general, those asserts were added when two visitors were merged to prevent accidentally going through previously completely untested code paths. Also I don't really like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11925
This avoids mypy from guessing subtype relationships because of the any fallback over here:
mypy/mypy/subtypes.py
Line 438 in e1bfb75