Setting the same name parameters gets the error message saying duplicate argument as shown below:
def func(param, param): pass
SyntaxError: 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, *): pass
SyntaxError: 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.
3.12
Linux
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)
gh-133379: Fix misuse of the term "arguments" in error messages (GH-1…
Thank you for your report, @hyperkai. It's amazing how long we ignored this mistake.
Thank you for your PR, @StanFromIreland.
There are other error messages using argument instead of parameter as shown below:
def func(*args1, *args2): pass # SyntaxError: * argument may appear only once def func(**kwargs, *args): pass # SyntaxError: arguments cannot follow var-keyword argument def func(*args=["John"]): pass # SyntaxError: var-positional argument cannot have default value def func(**kwargs={"name":"John"}): pass # SyntaxError: var-keyword argument cannot have default value
You need to pull the latest commits and build again.
pythongh-133379: Fix misuse of the term "arguments" in error messages (…
Activity
picnixz commented on 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)
gh-133379: Fix misuse of the term "arguments" in error messages (GH-1…
serhiy-storchaka commented on 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 commented on May 11, 2025
There are other error messages using argument instead of parameter as shown below:
StanFromIreland commented on 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 (…