[ty] Assume 3-argument form for variadics in type(...)#22502
Closed
charliermarsh wants to merge 3 commits intomainfrom
Closed
[ty] Assume 3-argument form for variadics in type(...)#22502charliermarsh wants to merge 3 commits intomainfrom
charliermarsh wants to merge 3 commits intomainfrom
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
Member
Author
|
(Also exploring whether we can change this in overload handling directly.) |
ef17a06 to
681a5e0
Compare
8df0d85 to
dd2fbb3
Compare
18c00ee to
6ff1857
Compare
6ff1857 to
f8ea65e
Compare
17aa09f to
56b1d6f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f8ea65e to
3639010
Compare
56b1d6f to
fbd2949
Compare
3639010 to
2e7567c
Compare
2e7567c to
1e9dc4f
Compare
fbd2949 to
3bf7fa3
Compare
1e9dc4f to
f57e174
Compare
3bf7fa3 to
e7f60c2
Compare
f57e174 to
1d2d277
Compare
Member
|
This makes sense to me too but -- given that both overloads are now heavily special-cased -- I think we can both simplify our code and improve error messages for our users if we just handle both overloads at the same time. Something like #22569? |
e7f60c2 to
a94d0ed
Compare
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
When we see a call like
type("Foo", *args, **kwargs), the overload resolution may assume the single-argument form, even though the user likely intended the 3-argument class-creation form. We now "manually" fall back to the three-argument form. Same goes for "incorrect" calls that pass more than one argument.