Closed
Labels
3.15bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Setting the same name parameters gets the error message saying duplicate argument as shown below:
def func(param, param):
passSyntaxError: duplicate argument 'param' in function definition
Setting * after all the parameters gets the error message saying at least one argument as shown below:
def func(param1, param2, *):
passSyntaxError: named arguments must follow bare *
So, argument should be replaced with parameter as shown below:
SyntaxError: duplicate parameter 'param' in function definition
SyntaxError: named parameters must follow bare *
*You can also see this issue.
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
3.15bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error
Activity
picnixz commentedon May 4, 2025
Formally speaking, here we indeed need to use "parameter" and not "argument". However, we only change error messages in the latest version to reduce breakage possibilities (thus, I don't think we'll backport this)
*parameter's error messages sayargumentinstead ofparameter#133436 as a duplicate of this issuegh-133379: Fix misuse of the term "arguments" in error messages (GH-1…
serhiy-storchaka commentedon May 10, 2025
Thank you for your report, @hyperkai. It's amazing how long we ignored this mistake.
Thank you for your PR, @StanFromIreland.
hyperkai commentedon May 11, 2025
There are other error messages using
argumentinstead ofparameteras shown below:StanFromIreland commentedon May 11, 2025
You need to pull the latest commits and build again.
pythongh-133379: Fix misuse of the term "arguments" in error messages (…
pythongh-133379: Fix misuse of the term "arguments" in error messages (…