summaryrefslogtreecommitdiff
path: root/doc/source/reference/arrays.interface.rst
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-07-08 14:39:36 +0300
committerGitHub <noreply@github.com>2022-07-08 14:39:36 +0300
commit7cd7fc643ac3cc49dea43583ab4a8ecf8164b9cc (patch)
treebe71ed8586101731e1db77e6919e3898aa9d8493 /doc/source/reference/arrays.interface.rst
parenta9fadb2060810efead3f1fd7997b5666cdab3305 (diff)
parent14092a017a1703610916bb6af7107b6eddcf31f6 (diff)
downloadnumpy-7cd7fc643ac3cc49dea43583ab4a8ecf8164b9cc.tar.gz
Merge pull request #21248 from ax3l/doc-improve-array-interface-data
DOC: improve description of the `data` entry in `__array_interface__`
Diffstat (limited to 'doc/source/reference/arrays.interface.rst')
-rw-r--r--doc/source/reference/arrays.interface.rst12
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/source/reference/arrays.interface.rst b/doc/source/reference/arrays.interface.rst
index e10710719..904d0132b 100644
--- a/doc/source/reference/arrays.interface.rst
+++ b/doc/source/reference/arrays.interface.rst
@@ -125,9 +125,15 @@ This approach to the interface consists of the object having an
**Default**: ``[('', typestr)]``
**data** (optional)
- A 2-tuple whose first argument is an integer (a long integer
- if necessary) that points to the data-area storing the array
- contents. This pointer must point to the first element of
+ A 2-tuple whose first argument is a :doc:`Python integer <c-api/long>`
+ that points to the data-area storing the array contents.
+
+ .. note::
+ When converting from C/C++ via ``PyLong_From*`` or high-level
+ bindings such as Cython or pybind11, make sure to use an integer
+ of sufficiently large bitness.
+
+ This pointer must point to the first element of
data (in other words any offset is always ignored in this
case). The second entry in the tuple is a read-only flag (true
means the data area is read-only).