Skip to content

Commit e2977f6

Browse files
Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22052)
Follow up to f7c4e23. (cherry picked from commit 700fa1b) Co-authored-by: Benjamin Peterson <[email protected]>
1 parent d14775d commit e2977f6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Doc/c-api/type.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ The following functions and structs are used to create
215215
* ``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`
216216
* ``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`
217217
218-
The following fields cannot be set using :c:type:`PyType_Spec` and :c:type:`PyType_Slot`:
218+
The following fields cannot be set at all using :c:type:`PyType_Spec` and
219+
:c:type:`PyType_Slot`:
219220
220221
* :c:member:`~PyTypeObject.tp_dict`
221222
* :c:member:`~PyTypeObject.tp_mro`
@@ -229,13 +230,21 @@ The following functions and structs are used to create
229230
(see :ref:`PyMemberDef <pymemberdef-offsets>`)
230231
* :c:member:`~PyTypeObject.tp_vectorcall_offset`
231232
(see :ref:`PyMemberDef <pymemberdef-offsets>`)
233+
234+
The following fields cannot be set using :c:type:`PyType_Spec` and
235+
:c:type:`PyType_Slot` under the limited API:
236+
232237
* :c:member:`~PyBufferProcs.bf_getbuffer`
233238
* :c:member:`~PyBufferProcs.bf_releasebuffer`
234239
235240
Setting :c:data:`Py_tp_bases` may be problematic on some platforms.
236241
To avoid issues, use the *bases* argument of
237242
:py:func:`PyType_FromSpecWithBases` instead.
238243
244+
.. versionchanged:: 3.9
245+
246+
Slots in :c:type:`PyBufferProcs` in may be set in the unlimited API.
247+
239248
.. c:member:: void *PyType_Slot.pfunc
240249
241250
The desired value of the slot. In most cases, this is a pointer

0 commit comments

Comments
 (0)