[red-knot] Move relation methods from CallableType to Signature#17365
Merged
dhruvmanila merged 1 commit intomainfrom Apr 14, 2025
Merged
[red-knot] Move relation methods from CallableType to Signature#17365dhruvmanila merged 1 commit intomainfrom
CallableType to Signature#17365dhruvmanila merged 1 commit intomainfrom
Conversation
Contributor
|
56a3864 to
3fc5654
Compare
dcreager
approved these changes
Apr 14, 2025
Member
dcreager
left a comment
There was a problem hiding this comment.
It's much easier to verify that this is a pure move with git diff on the command line than in the PR view... 😅
Member
Author
Interesting! Curious to know what your |
Member
[diff]
algorithm = histogram
colorMoved = zebra
colorMovedWS = ignore-all-space |
dcreager
added a commit
that referenced
this pull request
Apr 15, 2025
* main: (31 commits) [red-knot] Add some knowledge of `__all__` to `*`-import machinery (#17373) Update taiki-e/install-action digest to be7c31b (#17379) Update Rust crate mimalloc to v0.1.46 (#17382) Update PyO3/maturin-action action to v1.49.1 (#17384) Update Rust crate anyhow to v1.0.98 (#17380) dependencies: switch from `chrono` to `jiff` Update Rust crate bstr to v1.12.0 (#17385) [red-knot] Further optimize `*`-import visibility constraints (#17375) [red-knot] Minor 'member_lookup_with_policy' fix (#17407) [red-knot] Initial support for `dataclass`es (#17353) Sync vendored typeshed stubs (#17402) [red-knot] improve function/bound method type display (#17294) [red-knot] Move relation methods from `CallableType` to `Signature` (#17365) [syntax-errors] `await` outside async functions (#17363) [red-knot] optimize is_subtype_of for literals (#17394) [red-knot] add a large-union-of-string-literals benchmark (#17393) Update pre-commit dependencies (#17383) [red-knot] mypy_primer: Fail job on panic or internal errors (#17389) [red-knot] Document limitations of diagnostics-silencing in unreachable code (#17387) [red-knot] detect unreachable attribute assignments (#16852) ...
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.
Summary
This PR moves all the relation methods from
CallableTypetoSignature.The main reason for this is that
Signatureis going to be the common denominator between normal and overloaded callables and the core logic to check a certain relationship is going to just require the information that would exists onSignature. For example, to check whether an overloaded callable is a subtype of a normal callable, we need to check whether every overloaded signature is a subtype of the normal callable's signature. This "every" logic would become part of theCallableTypeand the core logic of checking the subtyping would exists onSignature.