-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Show closest candidates for misspellings : keyword argument case #7888
Show closest candidates for misspellings : keyword argument case #7888
Conversation
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.
Thanks, looks very good. I have just couple minor comments.
test-data/unit/check-kwargs.test
Outdated
[case testKeywordMisspellingFloatInt] | ||
def f(atter: float, btter: int) -> None: pass # N: "f" defined here | ||
x: int = 5 | ||
f(otter=x) # E: Unexpected keyword argument "otter" for "f"; did you mean "btter" or "atter"? |
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.
Could you please add a test or two involving *args
to be sure they don't interfere with the logic?
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.
Good catch!
Added some tests.
And the *args did interfere with the logic. --> improved logic
Add tests for *args Fix bugs with *args Remove redundant type check
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.
Thanks for updates, this looks almost ready, just two more style comments.
style improvements
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.
Thanks for updates, LGTM!
This fixes the following case outlined in #824
Unexpected keyword argument "otter" for "f"
is now
Unexpected keyword argument "otter" for "f"; did you mean "other"?