@@ -44,7 +44,7 @@ the elements exposed by an :class:`array.array` can be multi-byte values.
4444
4545An example consumer of the buffer interface is the:meth: `~io.BufferedIOBase.write `
4646method of file objects: any object that can export a series of bytes through
47- the buffer interface can be written to a file. While:meth: `write ` only
47+ the buffer interface can be written to a file. While:meth: `! write ` only
4848needs read-only access to the internal contents of the object passed to it,
4949other methods such as:meth: `~io.BufferedIOBase.readinto ` need write access
5050to the contents of their argument. The buffer interface allows objects to
@@ -102,7 +102,9 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
102102 ..c :member :: PyObject *obj
103103
104104 A new reference to the exporting object. The reference is owned by
105- the consumer and automatically decremented and set to ``NULL `` by
105+ the consumer and automatically released
106+ (i.e. reference count decremented)
107+ and set to ``NULL `` by
106108:c:func: `PyBuffer_Release `. The field is the equivalent of the return
107109 value of any standard C-API function.
108110
@@ -159,10 +161,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
159161 If it is ``0 ``,:c:member: `~Py_buffer.buf ` points to a single item representing
160162 a scalar. In this case,:c:member: `~Py_buffer.shape `,:c:member: `~Py_buffer.strides `
161163 and:c:member: `~Py_buffer.suboffsets ` MUST be ``NULL ``.
162-
163- The macro:c:macro: `PyBUF_MAX_NDIM ` limits the maximum number of dimensions
164- to 64. Exporters MUST respect this limit, consumers of multi-dimensional
165- buffers SHOULD be able to handle up to:c:macro: `PyBUF_MAX_NDIM ` dimensions.
164+ The maximum number of dimensions is given by:c:macro: `PyBUF_MAX_NDIM `.
166165
167166 ..c :member :: Py_ssize_t *shape
168167
@@ -215,6 +214,17 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
215214 freed when the buffer is released. The consumer MUST NOT alter this
216215 value.
217216
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+
218228.. _buffer-request-types :
219229
220230Buffer request types
@@ -225,7 +235,7 @@ object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical
225235structure of the memory can vary drastically, the consumer uses the *flags *
226236argument to specify the exact buffer type it can handle.
227237
228- All:c:data : `Py_buffer ` fields are unambiguously defined by the request
238+ All:c:type : `Py_buffer ` fields are unambiguously defined by the request
229239type.
230240
231241request-independent fields
@@ -438,7 +448,7 @@ Buffer-related functions
438448
439449 Send a request to *exporter * to fill in *view * as specified by *flags *.
440450 If the exporter cannot provide a buffer of the exact type, it MUST raise
441- :c:data: ` PyExc_BufferError `, set ``view->obj `` to ``NULL `` and
451+ :exc: ` BufferError `, set ``view->obj `` to ``NULL `` and
442452 return ``-1 ``.
443453
444454 On success, fill in *view *, set ``view->obj `` to a new reference
@@ -454,7 +464,8 @@ Buffer-related functions
454464
455465.. c:function:: void PyBuffer_Release(Py_buffer *view)
456466
457- Release the buffer *view * and decrement the reference count for
467+ Release the buffer *view * and release the:term: `strong reference `
468+ (i.e. decrement the reference count) to the view's supporting object,
458469 ``view->obj``. This function MUST be called when the buffer
459470 is no longer being used, otherwise reference leaks may occur.
460471
@@ -464,7 +475,7 @@ Buffer-related functions
464475
465476.. c:function:: Py_ssize_t PyBuffer_SizeFromFormat(const char *format)
466477
467- Return the implied:c:data : `~Py_buffer.itemsize ` from:c:data : `~Py_buffer.format `.
478+ Return the implied:c:member : `~Py_buffer.itemsize ` from:c:member : `~Py_buffer.format `.
468479 On error, raise an exception and return -1.
469480
470481 ..versionadded ::3.9
@@ -499,7 +510,7 @@ Buffer-related functions
499510 This function fails if *len* != *src->len*.
500511
501512
502- .. c:function:: int PyObject_CopyData(Py_buffer *dest,Py_buffer *src)
513+ .. c:function:: int PyObject_CopyData(PyObject *dest,PyObject *src)
503514
504515 Copy data from *src * to *dest * buffer. Can convert between C-style and
505516 or Fortran-style buffers.
@@ -524,7 +535,7 @@ Buffer-related functions
524535 and:c:macro: `PyBUF_WRITABLE ` is set in *flags *.
525536
526537 On success, set ``view->obj `` to a new reference to *exporter * and
527- return 0. Otherwise, raise:c:data: ` PyExc_BufferError `, set
538+ return 0. Otherwise, raise:exc: ` BufferError `, set
528539 ``view->obj `` to ``NULL `` and return ``-1 ``;
529540
530541 If this function is used as part of a:ref: `getbufferproc <buffer-structs >`,