diff options
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/f2py/python-usage.rst | 13 | ||||
-rw-r--r-- | doc/source/reference/c-api/array.rst | 2 | ||||
-rw-r--r-- | doc/source/user/c-info.beyond-basics.rst | 19 |
3 files changed, 18 insertions, 16 deletions
diff --git a/doc/source/f2py/python-usage.rst b/doc/source/f2py/python-usage.rst index c3379f6c5..db1ee1ec8 100644 --- a/doc/source/f2py/python-usage.rst +++ b/doc/source/f2py/python-usage.rst @@ -15,12 +15,13 @@ Routine wrappers are callable ``fortran`` type objects while wrappers to Fortran data have attributes referring to data objects. All ``fortran`` type objects have an attribute ``_cpointer`` that contains a -``CObject`` referring to the C pointer of the corresponding Fortran/C function -or variable at the C level. Such ``CObjects`` can be used as callback arguments -for F2PY generated functions to bypass the Python C/API layer for calling Python -functions from Fortran or C. This can be useful when the computational aspects -of such functions are implemented in C or Fortran and wrapped with F2PY (or any -other tool capable of providing the ``CObject`` of a function). +:c:type:`PyCapsule` referring to the C pointer of the corresponding Fortran/C function +or variable at the C level. Such ``PyCapsule`` objects can be used as callback +arguments for F2PY generated functions to bypass the Python C/API layer for +calling Python functions from Fortran or C. This can be useful when the +computational aspects of such functions are implemented in C or Fortran and +wrapped with F2PY (or any other tool capable of providing the ``PyCapsule`` +containing a function). Consider a Fortran 77 file ```ftype.f``: diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst index e4028b7b4..bb22a1b03 100644 --- a/doc/source/reference/c-api/array.rst +++ b/doc/source/reference/c-api/array.rst @@ -152,7 +152,7 @@ and its sub-types). .. c:function:: int PyArray_FinalizeFunc(PyArrayObject* arr, PyObject* obj) - The function pointed to by the CObject + The function pointed to by the :c:type:`PyCapsule` :obj:`~numpy.class.__array_finalize__`. The first argument is the newly created sub-type. The second argument (if not NULL) is the "parent" array (if the array was created using diff --git a/doc/source/user/c-info.beyond-basics.rst b/doc/source/user/c-info.beyond-basics.rst index a1523e514..c566b4595 100644 --- a/doc/source/user/c-info.beyond-basics.rst +++ b/doc/source/user/c-info.beyond-basics.rst @@ -470,13 +470,14 @@ The __array_finalize\__ method __new_\_ method nor the __init\__ method gets called. Instead, the sub-type is allocated and the appropriate instance-structure members are filled in. Finally, the :obj:`~numpy.class.__array_finalize__` - attribute is looked-up in the object dictionary. If it is present - and not None, then it can be either a CObject containing a pointer - to a :c:func:`PyArray_FinalizeFunc` or it can be a method taking a - single argument (which could be None) + attribute is looked-up in the object dictionary. If it is present and not + None, then it can be either a :c:type:`PyCapsule` containing a pointer to a + :c:func:`PyArray_FinalizeFunc` or it can be a method taking a single argument + (which could be None) - If the :obj:`~numpy.class.__array_finalize__` attribute is a CObject, then the pointer - must be a pointer to a function with the signature: + If the :obj:`~numpy.class.__array_finalize__` attribute is a + :c:type:`PyCapsule`, then the pointer must be a pointer to a function with + the signature: .. code-block:: c @@ -488,9 +489,9 @@ The __array_finalize\__ method is present). This routine can do anything it wants to. It should return a -1 on error and 0 otherwise. - If the :obj:`~numpy.class.__array_finalize__` attribute is not None nor a CObject, - then it must be a Python method that takes the parent array as an - argument (which could be None if there is no parent), and returns + If the :obj:`~numpy.class.__array_finalize__` attribute is not None nor a + :c:type:`PyCapsule`, then it must be a Python method that takes the parent + array as an argument (which could be None if there is no parent), and returns nothing. Errors in this method will be caught and handled. |