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
Fix pluralization in TypeError messages in getargs.c #78374
Comments
This ticket is to address comments by @terry.reedy on GitHub for PR #8395. Ref : #8395 (comment) Tests: In the 3 tests before this, the suffix 0, 2, or 3 is the number of arguments given. This would suggest 0a, 0b, 2a, and 3a for the suffixes here. I like 1min, 2min, 1max, and 2max even better. You can wait a bit for other reviews before changing. Blurb: Let us be more specific. For the patch as is, But if we add all the remaining fixes needed in this file (see below), we could write. Fixes: This patch follows existing expressions formatted into argument%s: Scope: I think we should finish the job in the file. The next line in both else clauses, Fixes for the following will break some test, which will then need fixing also. I checked all PyErr_Format entries and did not see anything other than %d arguments and %d elements. |
See also "expected %d arguments, got %zd" in Objects/typeobject.c. |
Thanks, this needs to be fixed only in Before suggestion : ➜ cpython git:(bpo34193) ✗ ./python -c "a = {}; a.__delattr__()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: expected 1 arguments, got 0 After suggested change : ➜ cpython git:(bpo34193) ✗ ./python -c "a = {}; a.__delattr__()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: expected 1 argument, got 0 Is there some doc on clarification of the difference between 'required' argument and positional argument errors. I was trying to write to tests for the changes and I couldn't find functions that hit the exact branch of code. Some of them generate required argument error and some of them generate positional argument expected error. I looked up in the argument clinic docs (https://docs.python.org/3/howto/clinic.html) but it's little hard for me to grasp as a beginner. Any pointers will be helpful. Thanks |
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: