Pass through ParamSpec relation check for non-overloaded signatures#23927
Merged
dhruvmanila merged 2 commits intomainfrom Mar 17, 2026
Merged
Pass through ParamSpec relation check for non-overloaded signatures#23927dhruvmanila merged 2 commits intomainfrom
dhruvmanila merged 2 commits intomainfrom
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 85.29%. The percentage of expected errors that received a diagnostic held steady at 78.13%. The number of fully passing files held steady at 64/132. |
|
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
sphinx
trio
flake8
|
cc13839 to
24accac
Compare
1854010 to
86be1f8
Compare
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-return-type |
0 | 0 | 1 |
| Total | 0 | 0 | 1 |
AlexWaygood
approved these changes
Mar 16, 2026
Member
AlexWaygood
left a comment
There was a problem hiding this comment.
LG! Just a few comments on comments
Member
Author
|
I'm going to go ahead and merge this but would for @dcreager to take a look at this as well. |
carljm
added a commit
that referenced
this pull request
Mar 17, 2026
* main: Pass through ParamSpec relation check for non-overloaded signatures (#23927) [ty] Narrow keyword arguments when unpacking dictionary instances (#23436) [ty] Implement Duboc's TDD optimization for unions of constraint sets (#23881) Remove the repository security policy in favor of the organization one (#24008) Remove the repository code of conduct in favor of the organization one (#24007)
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 updates the constraint set assignability check to only special case overloaded callables against a callable containing
ParamSpecand pass through any other callables to the check inSignature. This is to make sure forConcatenate(ref #23689) that we make sure that it goes through toSignaturewhere the type checking / constraint set building would take place.Here are the detailed list of changes:
In
check_callable_signature_pair_inner,ParamSpecas the only parameter tocheck_signature_pairParamSpecas the only parameter, update the other side to check whether it's an overloaded callable. The reason is that thesignatures_is_single_paramspeccan returnNoneeven for non-overloaded non-ParamSpec callable which we should delegate tocheck_signature_pairIn
check_signature_pair_inner,Topand gradual form handling. This is to support the delegation that happened fromcheck_callable_signature_pair_innerso that the constraint set contains a node for theParamSpectype variable because otherwise we would've short-circuit forTop/ gradual form cases.Test Plan
Make sure there are no regression and existing test cases pass.
I'm also working on top of this branch in #23689 to make sure these changes are valid, so far so good.