Uh oh!
There was an error while loading. Please reload this page.
gh-64502: Fix Argument Clinic support of optional groups with defaults - #155191
Conversation
…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>
Use a single dict which maps the number of arguments to the subset of parameters which accepts it, instead of a list of subsets and a set of already used counts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
GH-155209 is a backport of this pull request to the 3.15 branch. |
GH-155216 is a backport of this pull request to the 3.14 branch. |
GH-155217 is a backport of this pull request to the 3.13 branch. |
…defaults (GH-155191) (GH-155217) 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. (cherry picked from commit caac927) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…defaults (GH-155191) (GH-155216) 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. (cherry picked from commit caac927) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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=1023accepts 0, 1, 2 or 3 arguments.Ambiguous combinations of optional groups and parameters with a default value are now rejected.