Skip to content

Commit 4ddfb04

Browse files
[3.11] Docs: Document PyBUF_MAX_NDIM (GH-107865) (#107872)
(cherry picked from commit 637f7ff) Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 202efe1 commit 4ddfb04

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/c-api/buffer.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,14 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
161161
If it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing
162162
a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides`
163163
and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``.
164+
The maximum number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`.
164165

165-
The macro :c:macro:`PyBUF_MAX_NDIM` limits the maximum number of dimensions
166-
to 64. Exporters MUST respect this limit, consumers of multi-dimensional
167-
buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions.
166+
.. :c:macro:: PyBUF_MAX_NDIM
167+
168+
The maximum number of dimensions the memory represents.
169+
Exporters MUST respect this limit, consumers of multi-dimensional
170+
buffers SHOULD be able to handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions.
171+
Currently set to 64.
168172
169173
.. c:member:: Py_ssize_t *shape
170174

0 commit comments

Comments
 (0)