https://github.com/python/cpython/commit/cd3395a8b10f6bab912670e1d47d432aa2a21e71
commit: cd3395a8b10f6bab912670e1d47d432aa2a21e71
branch: 3.14
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: ambv <luk...@langa.pl>
date: 2025-05-21T16:33:35+02:00
summary:

[3.14] gh-132246: Add special buffer methods to C API Type Object docs 
(gh-132247) (gh-134426)

Two special methods, __buffer__ and __release_buffer__ were added to
Python 3.12 by PEP 688. The C API Type Object documentation for slots
includes `tp_as_buffer`, and sub-slots `bf_getbuffer`, `bf_releasebuffer`
but does not refer to the Python Data Model version of those. Add the
missing references.

(cherry picked from commit b529b60fc239d19245e5fafd0514d90097c2eb40)

Co-authored-by: Cody Maloney <cmalo...@users.noreply.github.com>

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

diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 64353a8daca5f6..5df0c0fe608e53 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -79,7 +79,7 @@ Quick Reference
    | :c:member:`~PyTypeObject.tp_setattro`          | :c:type:`setattrofunc`   
         | __setattr__,      | X | X |   | G |
    |                                                |                          
         | __delattr__       |   |   |   |   |
    
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
-   | :c:member:`~PyTypeObject.tp_as_buffer`         | :c:type:`PyBufferProcs` 
*         |                   |   |   |   | % |
+   | :c:member:`~PyTypeObject.tp_as_buffer`         | :c:type:`PyBufferProcs` 
*         | :ref:`sub-slots`  |   |   |   | % |
    
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
    | :c:member:`~PyTypeObject.tp_flags`             | unsigned long            
         |                   | X | X |   | ? |
    
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
@@ -325,9 +325,10 @@ sub-slots
    
+---------------------------------------------------------+-----------------------------------+---------------+
    |                                                                           
                                  |
    
+---------------------------------------------------------+-----------------------------------+---------------+
-   | :c:member:`~PyBufferProcs.bf_getbuffer`                 | 
:c:func:`getbufferproc`           |               |
+   | :c:member:`~PyBufferProcs.bf_getbuffer`                 | 
:c:func:`getbufferproc`           | __buffer__    |
    
+---------------------------------------------------------+-----------------------------------+---------------+
-   | :c:member:`~PyBufferProcs.bf_releasebuffer`             | 
:c:func:`releasebufferproc`       |               |
+   | :c:member:`~PyBufferProcs.bf_releasebuffer`             | 
:c:func:`releasebufferproc`       | __release_\   |
+   |                                                         |                 
                  | buffer\__     |
    
+---------------------------------------------------------+-----------------------------------+---------------+
 
 .. _slot-typedefs-table:

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to