You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please add getbufferproc and releasebufferproc to the limited API headers #98410
This means on the limited API starting with Python 3.11 it is now possible to do PyType_GetSlot(Py_TYPE(obj), Py_bf_getbuffer), however the void * returned does not have a function pointer type available which it can be cast to (unless the user adds this typedef themselves in their own code).
Pitch
This is a relatively straightforward change to make use of these type slots more convenient on the limited API.
I wrote an initial implementation at #31158. A couple of tiny tweaks beyond moving the typedefs was necessary so that forward definitions continued to function. Please see that PR for the detail.
I dislike the fact that most callback types used by PyTypeObject are not prefixed by Py_ prefix, nor use the same coding style (casing) than other names used by the Python API :-(
Activity
encukou commentedon Oct 31, 2022
Thank you!
gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)
vstinner commentedon Oct 31, 2022
I dislike the fact that most callback types used by PyTypeObject are not prefixed by
Py_prefix, nor use the same coding style (casing) than other names used by the Python API :-(binaryfunc, ternaryfunc, ssizeobjargproc, etc.