@@ -163,13 +163,6 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
163
163
and :c:member: `~Py_buffer.suboffsets ` MUST be ``NULL ``.
164
164
The maximum number of dimensions is given by :c:macro: `PyBUF_MAX_NDIM `.
165
165
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.
172
-
173
166
.. c :member :: Py_ssize_t *shape
174
167
175
168
An array of :c:type: `Py_ssize_t ` of length :c:member: `~Py_buffer.ndim `
@@ -221,6 +214,17 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
221
214
freed when the buffer is released. The consumer MUST NOT alter this
222
215
value.
223
216
217
+
218
+ Constants:
219
+
220
+ .. c :macro :: PyBUF_MAX_NDIM
221
+
222
+ The maximum number of dimensions the memory represents.
223
+ Exporters MUST respect this limit, consumers of multi-dimensional
224
+ buffers SHOULD be able to handle up to :c:macro: `!PyBUF_MAX_NDIM ` dimensions.
225
+ Currently set to 64.
226
+
227
+
224
228
.. _buffer-request-types :
225
229
226
230
Buffer request types
@@ -444,7 +448,7 @@ Buffer-related functions
444
448
445
449
Send a request to *exporter * to fill in *view * as specified by *flags *.
446
450
If the exporter cannot provide a buffer of the exact type, it MUST raise
447
- :c:data: ` PyExc_BufferError `, set ``view->obj `` to ``NULL `` and
451
+ :exc: ` BufferError `, set ``view->obj `` to ``NULL `` and
448
452
return ``-1 ``.
449
453
450
454
On success, fill in *view *, set ``view->obj `` to a new reference
@@ -531,7 +535,7 @@ Buffer-related functions
531
535
and :c:macro: `PyBUF_WRITABLE ` is set in *flags *.
532
536
533
537
On success, set ``view->obj `` to a new reference to *exporter * and
534
- return 0. Otherwise, raise :c:data: ` PyExc_BufferError `, set
538
+ return 0. Otherwise, raise :exc: ` BufferError `, set
535
539
``view->obj `` to ``NULL `` and return ``-1 ``;
536
540
537
541
If this function is used as part of a :ref: `getbufferproc <buffer-structs >`,
0 commit comments