diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-08-11 20:29:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 20:29:57 (GMT) |
commit | d20d52bc4d9910666706ea1fb4ca790f87acd06e (patch) | |
tree | 2669a9b1b6e6615933c1530021357917b2bc7607 | |
parent | 98dd9d9725e6fa137e14f00b2907fdec19aee4ac (diff) | |
download | cpython-d20d52bc4d9910666706ea1fb4ca790f87acd06e.zip cpython-d20d52bc4d9910666706ea1fb4ca790f87acd06e.tar.gz cpython-d20d52bc4d9910666706ea1fb4ca790f87acd06e.tar.bz2 |
[3.12] Docs: Document PyBUF_MAX_NDIM (GH-107865) (#107871)
Docs: Document PyBUF_MAX_NDIM (GH-107865)
(cherry picked from commit 637f7ff2c60f262659da0334f1cb672bd361f398)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
-rw-r--r-- | Doc/c-api/buffer.rst | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index 8ca1c19..ba391a5 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 |