Skip to content

gh-158320: Reject optional groups with a var-positional parameter in Argument Clinic - #158323

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:clinic-group-varpos-error
Sep 28, 2026
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:clinic-group-varpos-error

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Argument Clinic crashed with ValueError: required is empty but left is not if an optional group preceded a var-positional parameter, and reported a confusing error about positional-only parameters in the opposite order.

Both orders now fail with:

Function 'bar' cannot use optional groups with a var-positional parameter.

…er in Argument Clinic

Such a combination is ambiguous: the number of arguments does not tell
whether the group is passed or all arguments belong to the var-positional
parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant