-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-130947: Add again PySequence_Fast() to the limited C API #130948
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
Conversation
This PR basically does the opposite of PR #129398 which is part of Python v3.14.0a5 release. Instead of removing these APIs from the limited C API, this PR fixes the limited C API implementation of PySequence_Fast_GET_SIZE() and PySequence_Fast_GET_ITEM() macros, and it adds again PySequence_Fast() to the limited C API. PySequence_Fast_ITEMS() remains removed, since this function should be implemented in the limited C API. What changed since PR #129398 is that I discovered (via a bug report) that PyQt6 uses PySequence_Fast(). Moreover PyQt6 reimplements PySequence_Fast_GET_SIZE() and PySequence_Fast_GET_ITEM() macros in the limited C API. |
This should be considered a new feature and discussed with the C API Workgroup. Also, I do not think that it is right to replace fast macros with slower functions. |
Fast macros are not replaced with slower functions. In the regular C API, this PR changes nothing. It only changes the limited C API implementation to use function calls. |
@serhiy-storchaka: Do you still consider that my change is a new feature after my comment? Should I raise the issue to the C API Working Group? |
Add again PySequence_Fast() to the limited C API. Add unit tests.
I modified my PR to not add again PySequence_Fast_GET_SIZE() and PySequence_Fast_GET_ITEM() to the limited C API. The PR now only adds PySequence_Fast() back to the limited C API. |
|
|
I merged a minimum version of my change: only restore PySequence_Fast() function in the limited C API. |
Yes, I consider it as a new feature. And I will be against it. |
…thon#130948) Add again PySequence_Fast() to the limited C API. Add unit tests.
…thon#130948) Add again PySequence_Fast() to the limited C API. Add unit tests.
Add again PySequence_Fast(), PySequence_Fast_GET_SIZE() and PySequence_Fast_GET_ITEM() to the limited C API
Add an unit tests.
📚 Documentation preview 📚: https://cpython-previews--130948.org.readthedocs.build/