Please add getbufferproc
and releasebufferproc
to the limited API headers
#98410
Labels
getbufferproc
and releasebufferproc
to the limited API headers
#98410
Feature or enhancement
Starting with Python 3.11 the Py_Buffer API has been made available in the limited API, including the
bf_getbuffer
andbf_releasebuffer
type slots.However the definitions for the function pointer types stored in those slots,
getbufferproc
andreleasebufferproc
are still only defined when including "cpython" headers.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 thevoid *
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.
The text was updated successfully, but these errors were encountered: