Skip to content
Prev Previous commit
Next Next commit
Add docs
  • Loading branch information
tiran committed Feb 2, 2022
commit 92d2ea5565a08b3f7f97e7d094da04159abcc738
11 changes: 5 additions & 6 deletions Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ The following functions and structs are used to create
* :c:member:`~PyTypeObject.tp_vectorcall_offset`
(see :ref:`PyMemberDef <pymemberdef-offsets>`)

The following fields cannot be set using :c:type:`PyType_Spec` and
:c:type:`PyType_Slot` under the limited API:

* :c:member:`~PyBufferProcs.bf_getbuffer`
* :c:member:`~PyBufferProcs.bf_releasebuffer`

Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be
problematic on some platforms.
To avoid issues, use the *bases* argument of
Expand All @@ -287,6 +281,11 @@ The following functions and structs are used to create

Slots in :c:type:`PyBufferProcs` in may be set in the unlimited API.

.. versionchanged:: 3.11
:c:member:`~PyBufferProcs.bf_getbuffer` and
:c:member:`~PyBufferProcs.bf_releasebuffer` are now available
under limited API.

.. c:member:: void *PyType_Slot.pfunc

The desired value of the slot. In most cases, this is a pointer
Expand Down
20 changes: 20 additions & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,26 @@ New Features
:c:macro:`PY_VERSION_HEX`.
(Contributed by Gabriele N. Tornetta in :issue:`43931`.)

* :c:type:`Py_buffer` and APIs are now part of the limited API and the stable
ABI:

* :c:func:`PyObject_CheckBuffer`
* :c:func:`PyObject_GetBuffer`
* :c:func:`PyBuffer_GetPointer`
* :c:func:`PyBuffer_SizeFromFormat`
* :c:func:`PyBuffer_ToContiguous`
* :c:func:`PyBuffer_FromContiguous`
* :c:func:`PyBuffer_CopyData`
* :c:func:`PyBuffer_IsContiguous`
* :c:func:`PyBuffer_FillContiguousStrides`
* :c:func:`PyBuffer_FillInfo`
* :c:func:`PyBuffer_Release`
* :c:func:`PyMemoryView_FromBuffer`
* :c:member:`~PyBufferProcs.bf_getbuffer` and
:c:member:`~PyBufferProcs.bf_releasebuffer` type slots

(Contributed by Christian Heimes in :issue:`45459`.)


Porting to Python 3.11
----------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Add :c:type:`Py_buffer` to limited API / stable ABI.
:c:type:`Py_buffer` and various ``Py_buffer`` related functions are now
part of the limited API and stable ABI.