diff options
author | mattip <matti.picus@gmail.com> | 2018-09-17 11:56:03 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-09-17 11:56:03 +0300 |
commit | a6a0b0f6f75a3f00879506191e42328e1314016b (patch) | |
tree | 29458133bd5c1a8d46b3045be64dbed885c6fbce /doc | |
parent | 2ae3ae2280c54423d9be1f490d498490d52296ba (diff) | |
download | numpy-a6a0b0f6f75a3f00879506191e42328e1314016b.tar.gz |
DOC: warn about directly using PyUFuncObject and PyArray_Descr
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/reference/c-api.types-and-structures.rst | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/doc/source/reference/c-api.types-and-structures.rst b/doc/source/reference/c-api.types-and-structures.rst index c69eba9d7..4ad476ad9 100644 --- a/doc/source/reference/c-api.types-and-structures.rst +++ b/doc/source/reference/c-api.types-and-structures.rst @@ -182,8 +182,18 @@ PyArrayDescr_Type .. c:type:: PyArray_Descr - The format of the :c:type:`PyArray_Descr` structure that lies at the - heart of the :c:data:`PyArrayDescr_Type` is + The :c:type:`PyArray_Descr` structure lies at the heart of the + :c:data:`PyArrayDescr_Type`. While it is described here for + completeness, it should be considered internal to NumPy and manipulated via + ``PyArrayDescr_*`` or ``PyDataType*`` functions and macros. The size of this + structure is subject to change across versions of NumPy. To ensure + compatibility: + + - Never declare a non-pointer instance of the struct + - Never perform pointer arithmatic + - Never use ``sizof(PyArray_Descr)`` + + It has the following structure: .. code-block:: c @@ -685,7 +695,14 @@ PyUFunc_Type the information needed to call the underlying C-code loops that perform the actual work. While it is described here for completeness, it should be considered internal to NumPy and manipulated via ``PyUFunc_*`` - functions. It has the following structure: + functions. The size of this structure is subject to change across versions + of NumPy. To ensure compatibility: + + - Never declare a non-pointer instance of the struct + - Never perform pointer arithmatic + - Never use ``sizof(PyUFuncObject)`` + + It has the following structure: .. code-block:: c |