Skip to content

gh-133438: Fix the use of the terms "argument" and "parameter" in error messages for invalid function calls - #135172

Closed
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:errors-argument-vs-parameter
Closed

serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:errors-argument-vs-parameter

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 5, 2025 •

Copy link
Copy Markdown
Member

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

There is yet one error message left (for arguments for positional-only parameters passed by keyword), but it is more significant change and I want to discuss it separately.

@serhiy-storchaka serhiy-storchaka changed the title gh-135160: Fix the use of the terms "argument" and "parameter" in error messages for invalid function calls gh-133438: Fix the use of the terms "argument" and "parameter" in error messages for invalid function calls Jun 5, 2025
…in error messages for invalid function calls
@serhiy-storchaka
serhiy-storchaka force-pushed the errors-argument-vs-parameter branch from 68ec454 to e19eb6f Compare June 5, 2025 10:36
Comment thread Python/ceval.c
Py_ssize_t start, end;
int positional = (defcount != -1);
const char *kind = positional ? "positional" : "keyword-only";
const char *kind = positional ? "positional" : "keyword";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keeping keyword-only here, it's correct, no?

>>> def f(*, x): pass
... 
>>> f()
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    f()
    ~^^
TypeError: f() missing 1 required keyword-only argument: 'x'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Keyword-only" is a qualifier of a parameter. Arguments can be "positional" or "keyword".

@StanFromIreland

Copy link
Copy Markdown
Member

See also #139678

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 25, 2026
@hugovk

hugovk commented Sep 15, 2026

Copy link
Copy Markdown
Member

Let's close, per the issue: #133438 (comment).

@hugovk hugovk closed this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants