Skip to content

gh-64502: Support several optional groups on the same level in Argument Clinic - #155210

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:clinic-sibling-groups
Aug 5, 2026
Merged

gh-64502: Support several optional groups on the same level in Argument Clinic#155210
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:clinic-sibling-groups

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

Optional groups on the same nesting level, like in [y, x,] [n,] attr, can now be omitted independently of each other.
Only nested groups were supported before.

_curses.window.chgat is such a function: it accepts (attr), (n, attr), (y, x, attr) and (y, x, n, attr), and no nesting of groups can express this set.

A group is now identified by a unique number instead of its nesting level.

…Argument Clinic

Groups on the same nesting level, like in "[y, x,] [n,] attr", can now be
omitted independently of each other.  A group is now identified by a unique
number instead of its nesting level.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
serhiy-storchaka and others added 2 commits August 5, 2026 10:39
They were emitted in the iteration order of a set of group identifiers.
The identifiers of the groups before the required parameters are small
negative integers, -1 and -2 have the same hash, so their order depended
on the size of Py_hash_t, and the code generated on a 32-bit platform
differed from the checked in one.

They are now emitted in the order of the parameters.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	Tools/clinic/libclinic/clanguage.py
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 5, 2026 09:15
@serhiy-storchaka
serhiy-storchaka merged commit 7763c98 into python:main Aug 5, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant