summaryrefslogtreecommitdiff
path: root/Doc/c-api
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-08-08 14:33:28 +0200
committerStefan Krah <skrah@bytereef.org>2015-08-08 14:33:28 +0200
commitb8a435b04617484d14a00e1a676441a9ece4dcd4 (patch)
tree5d2fc0e883d9de3681872e33115e7cf3af76dd9b /Doc/c-api
parent38b9138929dad6cf09bcf8b7f7f545c0d6ef0151 (diff)
downloadcpython-b8a435b04617484d14a00e1a676441a9ece4dcd4.tar.gz
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.rst15
-rw-r--r--Doc/c-api/memoryview.rst2
2 files changed, 10 insertions, 7 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index e6330e7521..6cb474e80e 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 5e50977cbe..9f6bfd751a 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