bpo-47054: Call params parameters not arguments in SyntaxErrors.#32014
bpo-47054: Call params parameters not arguments in SyntaxErrors.#32014gpshead wants to merge 1 commit intopython:mainfrom
Conversation
A couple of SyntaxErrors were potentionally confusing in their wording due to the use of the term arguments when what it was referring are pedantically parameters as the errors happen at definition time. We unfortunately use the terms loosely in various parts of Python. https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter#:~:text=A%20parameter%20is%20the%20variable,function%20when%20it%20is%20called.
|
Wording questions to ponder: Are they "default parameters" or "keyword parameters" potentially with a "non-" prefix, or are they "parameters with a default" and "parameters without a default" or "naked parameters" or "lone parameters"? |
|
I'll update the golden value error message tests once we've agreed upon wording. |
|
The most verbose and explicit definition would be: "a parameter with a default argument". Afterall, it is a parameter that has a default argument that gets passed if there is no argument. You could shorten this to "a parameter with a default" (optionally including "value" at the end). Technically you could also say "defaulted parameter" (reads better) - because if no argument is passed the parameter is defaulted with a default argument - which would be even shorter. I do think "a keyword parameter" in the current changes might even be more confusing with a keyword-only parameter than the original saying of calling a parameter an argument though. |
|
Going off of my previous comment about a "defaulted parameter"; why not use "required parameter" for a parameter that lacks a default argument? Now not only will this PR be more technically accurate, it'll also make the error easier to read: - SyntaxError: non-default argument follows default argument
+ SyntaxError: required parameter follows defaulted parameter...alternatively (since there is still repetition)... - SyntaxError: non-default argument follows default argument
+ SyntaxError: required parameter follows parameter with a default valueI found myself tripping over the repetition of the previous error message and this should make it easy to tell the exact issue with the parameters. In the latter codeblock "value" could be replaced by "argument", either way it removes all repetition. |
|
Closing as has been fixed, issue is already closed. |
A couple of SyntaxErrors were potentionally confusing in their wording
due to the use of the term arguments when what it was referring are
pedantically parameters as the errors happen at definition time.
We unfortunately use the terms loosely in various parts of Python.
https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter#:~:text=A%20parameter%20is%20the%20variable,function%20when%20it%20is%20called.
https://bugs.python.org/issue47054