Skip to content
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

Improve error message for function calls with bad keyword arguments #107944

Closed
rhettinger opened this issue Aug 14, 2023 · 4 comments
Closed

Improve error message for function calls with bad keyword arguments #107944

rhettinger opened this issue Aug 14, 2023 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@rhettinger
Copy link
Contributor

rhettinger commented Aug 14, 2023

Current traceback message:

>>> pow(bass=5, exp=2)
Traceback (most recent call last):
  ...
TypeError: pow() missing required argument 'base' (pos 1)

Proposed:

>>> pow(bass=5, exp=2)
Traceback (most recent call last):
  ...
TypeError: pow() Keyword argument 'bass' not defined. Did you mean "base"?

Linked PRs

@rhettinger rhettinger added the type-feature A feature request or enhancement label Aug 14, 2023
@pablogsal
Copy link
Member

Ah, fantastic proposal! I will work on this this week

pablogsal added a commit to pablogsal/cpython that referenced this issue Aug 15, 2023
pablogsal added a commit to pablogsal/cpython that referenced this issue Aug 15, 2023
pablogsal added a commit to pablogsal/cpython that referenced this issue Aug 15, 2023
…yword arguments

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue Aug 15, 2023
…yword arguments

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue Aug 15, 2023
…yword arguments

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
@pablogsal
Copy link
Member

Will close after I add a what's new entry

@hugovk
Copy link
Member

hugovk commented Nov 9, 2023

(@pablogsal Reminder for the what's new entry)

@pablogsal
Copy link
Member

(@pablogsal Reminder for the what's new entry)

Thanks for the ping. In general I collect all of this in one PR but I will do this separately so I don't forget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants