[ty] Infer typevar specializations for implicit generic protocols#21902
Merged
[ty] Infer typevar specializations for implicit generic protocols#21902
Conversation
Typing conformance results improved 🎉The percentage of diagnostics emitted that were expected errors increased from 83.14% to 83.49%. The percentage of expected errors that received a diagnostic held steady at 74.24%. Summary
False positives removedDetails
|
6b69581 to
0bde415
Compare
874dc7e to
8871fdd
Compare
0bde415 to
fa1a940
Compare
Merging this PR will degrade performance by 19.23%
Performance Changes
Comparing |
|
7145810 to
6fb49ec
Compare
6fb49ec to
b0280a2
Compare
21736f1 to
138bf79
Compare
Memory usage reportSummary
Significant changesClick to expand detailed breakdownsphinx
flake8
trio
prefect
|
7dc401e to
06f1a23
Compare
sharkdp
reviewed
Feb 10, 2026
AlexWaygood
reviewed
Feb 10, 2026
Member
AlexWaygood
left a comment
There was a problem hiding this comment.
Awesome work!! This looks very reasonable to me
crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md
Outdated
Show resolved
Hide resolved
crates/ty_python_semantic/resources/mdtest/generics/pep695/classes.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
e9ab2d2 to
b66cf8b
Compare
This was referenced Feb 12, 2026
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.
We now infer specializations that involve generic protocols. This includes recursing into the methods of the protocol, matching up the signatures of the class's methods with the signatures of the protocol, and adding bindings for any typevars that appear in the protocol signatures.
This required several performance updates, which were pulled out and merged as separate PRs. There is still a performance and memory hit, but I think a reasonable one, given the new functionality that this opens up.
There are still some ecosystem false positives that relate to how this interacts with overload resolution, but I plan to tackle that in follow-on PRs.