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.
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
[red-knot] Use
Unknown | T_inferred
for undeclared public symbols #15674[red-knot] Use
Unknown | T_inferred
for undeclared public symbols #15674Changes from all commits
f7f3d92
9bf84e5
7a035b7
5bf3c9b
49bcf53
f29add5
36b3af6
f4ca4b8
a1c5647
1a1e08a
edb295e
96e8ae9
f10e976
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another instance of the callable problem. Notice how the usefulness of the error message degrades.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is really begging for nested diagnostics (so you get both "Object of type
NonCallable
is not callable" and nested details explaining why.)We could easily adjust the handling so you still get "Object of type
NonCallable
is not callable" here, but then you lose the details of which union element failed callability.Even without nested diagnostics we could still provide all of the information here in a new error, it just requires more and more bespoke error-cases handling in the
__call__
lookup code. (We would need to match on the case that callability of__call__
failed due to a union, and then write a new custom error message for that case which mentions both the outerNonCallable
type and the details of why its__call__
isn't callable.) Nested diagnostics would just let us handle this kind of situation more generically, with less special casing.cc @BurntSushi @MichaReiser re diagnostics considerations