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
Gramatically incorrect error message for some calls with wrong number of arguments #78308
Comments
`{}.get()`
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: get expected at least 1 arguments, got 0 Shouldn't that be "TypeError: get expected at least 1 argument, got 0" instead? |
Yes. 0 things, (1/2 thing), 1 thing, (3/2 things), 2... things is the bugaboo of formatting sentences with a number field. Raymond, will we accept a patch for this? |
Another test case:
Traceback (most recent call last):
File "<pyshell#25>", line 2, in check
TypeError: classmethod expected 1 arguments, got 0 |
Is this still active? I want to fix the patch. |
If the patch is simple and minimal, then this seems like a minor but nice little improvement. |
I have added a simple patch based on the changes by https://bugs.python.org/issue29951. The C code related error messages doesn't seem to have been covered by tests and I have added some tests. I have limited knowledge of C and this is my first C patch so code comments if any will be helpful. Thanks |
We don't normally backport an exception message change unless its content, as opposed to style, is erroneous. |
Nice work. Thanks for the patch. |
Thanks, I have created https://bugs.python.org/issue34193 to address PR comments and further enhancements in getargs.c |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: