Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-107944: Improve error message for function calls with bad keyword arguments#107969

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 1 commit intopython:mainfrompablogsal:gh-107944
Aug 17, 2023

Conversation

pablogsal
Copy link
Member

@pablogsalpablogsal commentedAug 15, 2023
edited by bedevere-bot
Loading

Py_DECREF(suggestion_keyword);
} else {
_PyErr_Format(tstate, PyExc_TypeError,
"%U() got an unexpected keyword argument '%S'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wouldn't it be a better UX if we included a list with all the possible keywords here? We could special-case it for cases where the list is smaller than X, in order to keep the output to a reasonable size.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think is better, but on the other hand, it would be a bunch of extra code (joining the list with commas + handling errors) so not sure if is worth the complexity.@rhettinger what do you think? (Note we are referring to the fallback message when we could not find the suggestion either because of errors or because there is nothing close).

lysnikolaou reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

what do you think?

I think what you have now will suffice — only offer a suggestion when a plausible candidate can be found; otherwise, just note that the keyword argument doesn't match.

…yword argumentsSigned-off-by: Pablo Galindo <pablogsal@gmail.com>
@pablogsal
Copy link
MemberAuthor

@lysnikolaou apart from the suggestion is everything else ok with you? (In that case, could you approve the PR?)

Copy link
Member

@lysnikolaoulysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good!!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@lysnikolaoulysnikolaoulysnikolaou approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@rhettingerrhettingerAwaiting requested review from rhettinger

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@pablogsal@rhettinger@lysnikolaou@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp