diff options
author | Stefan Krah <skrah@bytereef.org> | 2015-08-08 12:33:28 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2015-08-08 12:33:28 (GMT) |
commit | 70e543b266d273217869091b90a3cedbe32b4a2e (patch) | |
tree | 2615139467bb6fa052635ec6f8c53187e600a341 /Doc/c-api | |
parent | 0c51595a784787d8e198af910cb6d79172ee52bb (diff) | |
download | cpython-70e543b266d273217869091b90a3cedbe32b4a2e.zip cpython-70e543b266d273217869091b90a3cedbe32b4a2e.tar.gz cpython-70e543b266d273217869091b90a3cedbe32b4a2e.tar.bz2 |
Issue #23756: Clarify the terms "contiguous" and "bytes-like object".
Patch by Martin Panter.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/buffer.rst | 15 | ||||
-rw-r--r-- | Doc/c-api/memoryview.rst | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index e6330e7..6cb474e 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -96,8 +96,8 @@ a buffer, see :c:func:`PyObject_GetBuffer`. block of the exporter. For example, with negative :c:member:`~Py_buffer.strides` the value may point to the end of the memory block. - For contiguous arrays, the value points to the beginning of the memory - block. + For :term:`contiguous` arrays, the value points to the beginning of + the memory block. .. c:member:: void \*obj @@ -281,11 +281,14 @@ of the flags below it. +-----------------------------+-------+---------+------------+ +.. index:: contiguous, C-contiguous, Fortran contiguous + contiguity requests ~~~~~~~~~~~~~~~~~~~ -C or Fortran contiguity can be explicitly requested, with and without stride -information. Without stride information, the buffer must be C-contiguous. +C or Fortran :term:`contiguity <contiguous>` can be explicitly requested, +with and without stride information. Without stride information, the buffer +must be C-contiguous. .. tabularcolumns:: |p{0.35\linewidth}|l|l|l|l| @@ -466,13 +469,13 @@ Buffer-related functions .. c:function:: int PyBuffer_IsContiguous(Py_buffer *view, char order) Return 1 if the memory defined by the *view* is C-style (*order* is - ``'C'``) or Fortran-style (*order* is ``'F'``) contiguous or either one + ``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either one (*order* is ``'A'``). Return 0 otherwise. .. c:function:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char order) - Fill the *strides* array with byte-strides of a contiguous (C-style if + Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the given shape with the given number of bytes per element. diff --git a/Doc/c-api/memoryview.rst b/Doc/c-api/memoryview.rst index 5e50977..9f6bfd7 100644 --- a/Doc/c-api/memoryview.rst +++ b/Doc/c-api/memoryview.rst @@ -35,7 +35,7 @@ any other object. .. c:function:: PyObject *PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order) - Create a memoryview object to a contiguous chunk of memory (in either + Create a memoryview object to a :term:`contiguous` chunk of memory (in either 'C' or 'F'ortran *order*) from an object that defines the buffer interface. If memory is contiguous, the memoryview object points to the original memory. Otherwise, a copy is made and the memoryview points to a |