diff options
author | Axel Huebl <axel.huebl@plasma.ninja> | 2022-03-25 23:58:02 -0700 |
---|---|---|
committer | Axel Huebl <axel.huebl@plasma.ninja> | 2022-03-26 00:05:58 -0700 |
commit | 45b049dced8d846647546759598c9665a1398a92 (patch) | |
tree | 8bb36a9feefe7c822bf394a1276b50e4129ad963 | |
parent | 72b1203d4b4979e52a14e7bc3cd42704f69ead12 (diff) | |
download | numpy-45b049dced8d846647546759598c9665a1398a92.tar.gz |
DOC: Improve Array Interface `data`
The previous guidance on the integer type of `data` was a bit
misleading in practice and has now been improved.
In practice, Unix is fine with `int` (32bit) and `long` (64bit),
but Windows requires `long long` to hold a pointer.
https://en.cppreference.com/w/cpp/language/types
In order not to complicate the guidance, recommend the `intptr_t`
type explicitly.
-rw-r--r-- | doc/source/reference/arrays.interface.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/source/reference/arrays.interface.rst b/doc/source/reference/arrays.interface.rst index e10710719..2f843d2af 100644 --- a/doc/source/reference/arrays.interface.rst +++ b/doc/source/reference/arrays.interface.rst @@ -125,8 +125,10 @@ 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 + A 2-tuple whose first argument is a signed integer (capable of + holding a pointer to ``void`` such as the C/C++ type + `intptr_t <https://en.cppreference.com/w/cpp/types/integer>`__) + that points to the data-area storing the array contents. 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 |