[ty] Preserve uncertain reflected operator dispatch#26474
Open
charliermarsh wants to merge 1 commit into
Open
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 94.47%. The percentage of expected errors that received a diagnostic held steady at 89.19%. The number of fully passing files held steady at 95/134. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
sphinx
trio
flake8
|
5def2ee to
6764cb1
Compare
6f58caf to
1716dd9
Compare
Member
|
Not sure why the bot hasn't posted here, but note that there is an ecosystem diff here https://github.com/astral-sh/ruff/actions/runs/28457717664/attempts/1#summary-84337686112 |
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 is a follow-up to #26434 that preserves both binary-operation dispatch results when static operand types do not determine their exact runtime classes.
For
left: Baseandright: Child, the runtime operands may beBase + Child, whereChild.__radd__has priority, orChild + Child, whereBase.__add__is called. We previously selected only the reflected result from the static subtype relationship.This change classifies reflected priority as never, possible, or definite. Possible priority unions the normal and reflected call bindings; definite priority remains precise for exact left runtime classes such as the integer literal in
0 | Permission.READ. Bounded TypeVars and NewTypes use the same conservative distinction.