[Python-checkins] Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22031)

Benjamin Peterson webhook-mailer at python.org
Tue Sep 1 21:36:50 EDT 2020


https://github.com/python/cpython/commit/700fa1b836f315048e8b89ede5018a0c0a213946
commit: 700fa1b836f315048e8b89ede5018a0c0a213946
branch: master
author: Benjamin Peterson <benjamin at python.org>
committer: GitHub <noreply at github.com>
date: 2020-09-01T20:36:42-05:00
summary:

Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22031)

Follow up to f7c4e236429606e1c982cacf24e10fc86ef4462f.

files:
M Doc/c-api/type.rst

diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
index 7309d7ee2cd39..73f26875d8194 100644
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -225,7 +225,8 @@ The following functions and structs are used to create
       * ``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`
       * ``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`
 
-      The following fields cannot be set using :c:type:`PyType_Spec` and :c:type:`PyType_Slot`:
+      The following fields cannot be set at all using :c:type:`PyType_Spec` and
+      :c:type:`PyType_Slot`:
 
       * :c:member:`~PyTypeObject.tp_dict`
       * :c:member:`~PyTypeObject.tp_mro`
@@ -239,6 +240,10 @@ The following functions and structs are used to create
         (see :ref:`PyMemberDef <pymemberdef-offsets>`)
       * :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`
 
@@ -246,6 +251,10 @@ The following functions and structs are used to create
       To avoid issues, use the *bases* argument of
       :py:func:`PyType_FromSpecWithBases` instead.
 
+     .. versionchanged:: 3.9
+
+        Slots in :c:type:`PyBufferProcs` in may be set in the unlimited API.
+
    .. c:member:: void *PyType_Slot.pfunc
 
       The desired value of the slot. In most cases, this is a pointer



More information about the Python-checkins mailing list