-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Type inference for comprehensions #20962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sharkdp
wants to merge
1
commit into
main
Choose a base branch
from
david/fix-1388
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Diagnostic diff on typing conformance testsChanges were detected when running ty on typing conformance tests--- old-output.txt 2025-10-18 18:33:16.963638019 +0000
+++ new-output.txt 2025-10-18 18:33:20.334660680 +0000
@@ -37,7 +37,7 @@
aliases_implicit.py:72:5: error[type-assertion-failure] Argument does not have asserted type `(...) -> None`
aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[Unknown | <class 'int'> | <class 'str'>]` is not allowed in a type expression
aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[<class 'int'>, <class 'str'>]]` is not allowed in a type expression
-aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[@Todo(list comprehension element type)]` is not allowed in a type expression
+aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[<class 'int'>]` is not allowed in a type expression
aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression
aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression
aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression |
|
Lint rule | Added | Removed | Changed |
---|---|---|---|
invalid-argument-type |
262 | 0 | 84 |
invalid-assignment |
280 | 0 | 15 |
invalid-return-type |
180 | 0 | 10 |
possibly-missing-attribute |
29 | 2 | 38 |
unresolved-attribute |
45 | 0 | 1 |
unsupported-operator |
30 | 0 | 12 |
unused-ignore-comment |
0 | 21 | 0 |
no-matching-overload |
17 | 0 | 0 |
not-iterable |
5 | 0 | 9 |
index-out-of-bounds |
13 | 0 | 0 |
non-subscriptable |
2 | 0 | 6 |
possibly-missing-implicit-call |
2 | 0 | 2 |
call-non-callable |
1 | 0 | 0 |
missing-argument |
1 | 0 | 0 |
possibly-unresolved-reference |
0 | 1 | 0 |
type-assertion-failure |
0 | 1 | 0 |
Total | 867 | 25 | 177 |
|
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
Naive first implementation, not ready for review. Not even for you, Alex.
Test Plan