Fix bug when narrowing union containing custom eq against custom eq#20754
Open
hauntsaninja wants to merge 1 commit intopython:masterfrom
Open
Fix bug when narrowing union containing custom eq against custom eq#20754hauntsaninja wants to merge 1 commit intopython:masterfrom
hauntsaninja wants to merge 1 commit intopython:masterfrom
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: pip (https://github.com/pypa/pip)
+ src/pip/_internal/resolution/resolvelib/candidates.py:293: error: Item "None" of "Link | None" has no attribute "is_wheel" [union-attr]
+ src/pip/_internal/resolution/resolvelib/candidates.py:293: error: Item "None" of "Link | None" has no attribute "is_file" [union-attr]
+ src/pip/_internal/resolution/resolvelib/candidates.py:294: error: Item "None" of "Link | None" has no attribute "filename" [union-attr]
+ src/pip/_internal/resolution/resolvelib/candidates.py:305: error: Item "None" of "Link | None" has no attribute "is_wheel" [union-attr]
+ src/pip/_internal/resolution/resolvelib/candidates.py:306: error: Item "None" of "Link | None" has no attribute "is_file" [union-attr]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/tests/test_examples.py: note: In function "test_scoped_id":
+ schema_salad/tests/test_examples.py:395:23: error: Argument 2 to "makerdf" has incompatible type "int | float | str | CommentedMap | CommentedSeq | None"; expected "CommentedMap | float | str | CommentedSeq" [arg-type]
+ schema_salad/tests/test_examples.py:408:23: error: Argument 2 to "makerdf" has incompatible type "int | float | str | CommentedMap | CommentedSeq | None"; expected "CommentedMap | float | str | CommentedSeq" [arg-type]
+ schema_salad/tests/test_examples.py:421:23: error: Argument 2 to "makerdf" has incompatible type "int | float | str | CommentedMap | CommentedSeq | None"; expected "CommentedMap | float | str | CommentedSeq" [arg-type]
+ schema_salad/tests/test_examples.py:434:23: error: Argument 2 to "makerdf" has incompatible type "int | float | str | CommentedMap | CommentedSeq | None"; expected "CommentedMap | float | str | CommentedSeq" [arg-type]
|
Collaborator
Author
|
Oh cool, for first time primer indicates we now actually do have a place where unsoundly special casing None could make sense |
Contributor
|
Tested: works. Thanks! |
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.
I rewrote the logic for custom equality in #20643 . This is a soundness bug in that rewrite.
Fixes #20750