[Python-checkins] Docs: Document PyBUF_MAX_NDIM (#107865)

erlend-aasland webhook-mailer at python.org
Fri Aug 11 12:03:56 EDT 2023


https://github.com/python/cpython/commit/637f7ff2c60f262659da0334f1cb672bd361f398
commit: 637f7ff2c60f262659da0334f1cb672bd361f398
branch: main
author: Erlend E. Aasland <erlend at python.org>
committer: erlend-aasland <erlend.aasland at protonmail.com>
date: 2023-08-11T18:03:53+02:00
summary:

Docs: Document PyBUF_MAX_NDIM (#107865)

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

diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index 8ca1c190dab9a..ba391a5279f20 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -161,10 +161,14 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
       If it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing
       a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides`
       and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``.
+      The maximum number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`.
 
-      The macro :c:macro:`PyBUF_MAX_NDIM` limits the maximum number of dimensions
-      to 64. Exporters MUST respect this limit, consumers of multi-dimensional
-      buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions.
+   .. :c:macro:: PyBUF_MAX_NDIM
+
+      The maximum number of dimensions the memory represents.
+      Exporters MUST respect this limit, consumers of multi-dimensional
+      buffers SHOULD be able to handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions.
+      Currently set to 64.
 
    .. c:member:: Py_ssize_t *shape
 



More information about the Python-checkins mailing list