gh-117613: Argument Clinic: ensure that defining_class params are positional-only#117781
Conversation
We also have |
|
I failed to make a test. I should have said that |
In that case, you can use |
|
As long as the AC generates the check as cc @encukou @vstinner: The issue, I think, is that the AC can make a keyword tuple whose size has an extra count of a |
|
An alternative would be not to use a static keyword tuple when |
You can run |
|
I propose #117896 to enhance |
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
@erlend-aasland: Do you want to double check?
|
You should rebase your PR on main and re-run |
defining_class params are positional-only
|
@vstinner, I think we should backport this to 3.12. |
|
I think I'm not finished rerunning |
No problem; auto-merge will only work if the CI is green :) |
|
Thanks, @neonene! I synced with |
|
Thanks for reviewing and pointing out my mistakes, @vstinner @erlend-aasland. |
This comment was marked as outdated.
This comment was marked as outdated.
|
Sorry, @neonene and @erlend-aasland, I could not cleanly backport this to |
|
@neonene, do you want to do the backport? |
|
Thanks @neonene for this nice fix. I never noticed that generated code was wrong. |
… are positional-only (python#117781)
This ensures that the AC regards
defining_classas positional only, so that_PyArg_UnpackKeywords()can avoid a crash when a keyword mismatches. The crash is not reproducible intest_clinic.c, as it definesPy_BUILD_CORE_MODULE.cpython/Python/getargs.c
Lines 2515 to 2526 in 25f6ff5
defining_classand no slash #117613