diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-12-18 21:04:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 21:04:03 +0200 |
commit | 0cea652454fdd04fb90266865792281ef5404b8c (patch) | |
tree | 8f98208d1c2d477f61636185c00f95a3d8b7c4dc /doc/source/reference/c-api | |
parent | 01289c221ef45ed398f5c3822501692e849f1859 (diff) | |
parent | c5da77d47309b6bf11f13f3b2e760f9b21423427 (diff) | |
download | numpy-0cea652454fdd04fb90266865792281ef5404b8c.tar.gz |
Merge pull request #14933 from seberg/cleanup-converttocommontype
API: Use `ResultType` in `PyArray_ConvertToCommonType`
Diffstat (limited to 'doc/source/reference/c-api')
-rw-r--r-- | doc/source/reference/c-api/array.rst | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst index 0530a5747..c910efa60 100644 --- a/doc/source/reference/c-api/array.rst +++ b/doc/source/reference/c-api/array.rst @@ -1255,14 +1255,18 @@ Converting data types Convert a sequence of Python objects contained in *op* to an array of ndarrays each having the same data type. The type is selected - based on the typenumber (larger type number is chosen over a - smaller one) ignoring objects that are only scalars. The length of - the sequence is returned in *n*, and an *n* -length array of - :c:type:`PyArrayObject` pointers is the return value (or ``NULL`` if an - error occurs). The returned array must be freed by the caller of - this routine (using :c:func:`PyDataMem_FREE` ) and all the array objects - in it ``DECREF`` 'd or a memory-leak will occur. The example - template-code below shows a typically usage: + in the same way as `PyArray_ResultType`. The length of the sequence is + returned in *n*, and an *n* -length array of :c:type:`PyArrayObject` + pointers is the return value (or ``NULL`` if an error occurs). + The returned array must be freed by the caller of this routine + (using :c:func:`PyDataMem_FREE` ) and all the array objects in it + ``DECREF`` 'd or a memory-leak will occur. The example template-code + below shows a typically usage: + + .. versionchanged:: 1.18.0 + A mix of scalars and zero-dimensional arrays now produces a type + capable of holding the scalar value. + Previously priority was given to the dtype of the arrays. .. code-block:: c |