summaryrefslogtreecommitdiff
path: root/doc/source/reference/c-api
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-01-16 17:07:19 -0600
committerGitHub <noreply@github.com>2020-01-16 17:07:19 -0600
commite4c91ccbae79d693970fe3d54e8f771804f90c32 (patch)
tree575e5ffc2410763099bac2775a6a998e4da07e21 /doc/source/reference/c-api
parent57e20038e4efac1a7b4828881c3f8fe6438b3c11 (diff)
parentf38504c5bef425c7dbd372c904a7d9e9bbfe389c (diff)
downloadnumpy-e4c91ccbae79d693970fe3d54e8f771804f90c32.tar.gz
Merge pull request #15118 from mattip/cleanup-array-call
API: remove undocumented use of __array__(dtype, context)
Diffstat (limited to 'doc/source/reference/c-api')
-rw-r--r--doc/source/reference/c-api/array.rst21
1 files changed, 10 insertions, 11 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst
index e396ee020..ce8671a51 100644
--- a/doc/source/reference/c-api/array.rst
+++ b/doc/source/reference/c-api/array.rst
@@ -426,10 +426,8 @@ From other objects
may be 0. Also, if *op* is not already an array (or does not
expose the array interface), then a new array will be created (and
filled from *op* using the sequence protocol). The new array will
- have :c:data:`NPY_ARRAY_DEFAULT` as its flags member. The *context* argument
- is passed to the :obj:`~numpy.class.__array__` method of *op* and is only used if
- the array is constructed that way. Almost always this
- parameter is ``NULL``.
+ have :c:data:`NPY_ARRAY_DEFAULT` as its flags member. The *context*
+ argument is unused.
.. c:var:: NPY_ARRAY_C_CONTIGUOUS
@@ -574,6 +572,8 @@ From other objects
:c:data:`NPY_ARRAY_WRITEABLE` to PyArray_FromAny, where the writeable array may
be a copy of the input.
+ `context` is not used.
+
When success (0 return value) is returned, either out_arr
is filled with a non-NULL PyArrayObject and
the rest of the parameters are untouched, or out_arr is
@@ -677,10 +677,8 @@ From other objects
PyObject* op, PyArray_Descr* dtype, PyObject* context)
Return an ndarray object from a Python object that exposes the
- :obj:`~numpy.class.__array__` method. The :obj:`~numpy.class.__array__` method can take 0, 1, or 2
- arguments ([dtype, context]) where *context* is used to pass
- information about where the :obj:`~numpy.class.__array__` method is being called
- from (currently only used in ufuncs).
+ :obj:`~numpy.class.__array__` method. The :obj:`~numpy.class.__array__`
+ method can take 0, or 1 argument ``([dtype])``. ``context`` is unused.
.. c:function:: PyObject* PyArray_ContiguousFromAny( \
PyObject* op, int typenum, int min_depth, int max_depth)
@@ -859,15 +857,16 @@ General check of Python Type
conversion occurs. Otherwise, out will contain a borrowed
reference to :c:data:`Py_NotImplemented` and no error condition is set.
-.. c:function:: PyArray_HasArrayInterfaceType(op, type, context, out)
+.. c:function:: PyArray_HasArrayInterfaceType(op, dtype, context, out)
If ``op`` implements any part of the array interface, then ``out``
will contain a new reference to the newly created ndarray using
the interface or ``out`` will contain ``NULL`` if an error during
conversion occurs. Otherwise, out will contain a borrowed
reference to Py_NotImplemented and no error condition is set.
- This version allows setting of the type and context in the part of
- the array interface that looks for the :obj:`~numpy.class.__array__` attribute.
+ This version allows setting of the dtype in the part of the array interface
+ that looks for the :obj:`~numpy.class.__array__` attribute. `context` is
+ unused.
.. c:function:: PyArray_IsZeroDim(op)