New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-116646: Remove _PyLong_FileDescriptor_Converter() #116736
Conversation
Argument Clinic now calls directly PyObject_AsFileDescriptor() for the "fildes" format. Add tests on the "fildes" format in _testclinic_limited.
This change makes the "fildes" format compatible with the limited C API. I don't think that anyone used |
@erlend-aasland: Would you mind to review this PR? |
See also PR #116753 |
The converter is used if for some reasons the parsing code cannot be inlined and the |
Oops, I sent a ping, and just after posting it, I saw that you already replied!
I didn't know that. Do you have examples of cases when AC cannot inline code? Maybe we should treat these cases as "not implemented" and issue an error, rather than always having to maintain two code paths to parse arguments. It's always possible to workaround these "not supported" cases by declaring all arguments as "object" and parse arguments inside the function. |
Apparently, my PR doesn't work as expected. I wrote a simpler PR: #116769 |
The principle is that inlining the parsing code and using faster calling conventions is an optimization, and that Argument Clinic should work independently from optimization. In worst case it should produce less optimal code, but not fail.
|
Ok, I see. Maybe we can add support for these types directly to AC.
That's a corner case. I don't think that we should support any type in optional groups.
We may try to write a limited C API implementation. But ok, now I understand better the problem. Thanks a lot for your explanation! For now, I wrote a way simpler PR which avoids these issues: PR gh-116769. |
Argument Clinic now calls directly PyObject_AsFileDescriptor() for the "fildes" format.
Add tests on the "fildes" format in _testclinic_limited.