Skip to content

gh-64502: Fix Argument Clinic support of optional groups with defaults - #155191

Open
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:clinic-groups-defaults
Open

gh-64502: Fix Argument Clinic support of optional groups with defaults#155191
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:clinic-groups-defaults

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 4, 2026

Copy link
Copy Markdown
Member

Parameters with a default value which are not in any group were always required in the generated argument parsing code, although they were rendered as optional in the signature.

They can now be omitted: [y, x,] n=1023 accepts 0, 1, 2 or 3 arguments.

Ambiguous combinations of optional groups and parameters with a default value are now rejected.

…efaults

Parameters with a default value which are not in any group were always
required in the generated argument parsing code, although they were
rendered as optional in the signature.  They can now be omitted, and
ambiguous combinations of optional groups and parameters with a default
value are rejected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…linic.c

The added test functions made the preprocessed method table exceed the
default limit of the C globals checker.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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