diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-01-26 16:40:00 -0500 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-01-26 16:40:00 -0500 |
commit | 2864715a88cc0646f432024d0d21a1e10dde9ada (patch) | |
tree | d33ba8ddb06850e6372d2a59ec63b95a5726876f /doc/source/reference/c-api.array.rst | |
parent | 937d1f25e5fee1543a55ef5e6bcf27e5a7ec3bf9 (diff) | |
parent | 821072b735d393820e9500ccfad34c78e2885bb2 (diff) | |
download | numpy-2864715a88cc0646f432024d0d21a1e10dde9ada.tar.gz |
Merge pull request #5249 from immerrr/add-missing-scalar-func-docs
DOC: add documentation for some scalar checks
Diffstat (limited to 'doc/source/reference/c-api.array.rst')
-rw-r--r-- | doc/source/reference/c-api.array.rst | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 9b8cc04b6..5911eaa68 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -806,15 +806,28 @@ General check of Python Type sub-type of :cdata:`PyGenericArr_Type` ), or an instance of (a sub-class of) :cdata:`PyArray_Type` whose dimensionality is 0. +.. cfunction:: PyArray_IsPythonNumber(op) + + Evaluates true if *op* is an instance of a builtin numeric type (int, + float, complex, long, bool) + .. cfunction:: PyArray_IsPythonScalar(op) - Evaluates true if *op* is a builtin Python "scalar" object (int, + Evaluates true if *op* is a builtin Python scalar object (int, float, complex, str, unicode, long, bool). .. cfunction:: PyArray_IsAnyScalar(op) - Evaluates true if *op* is either a Python scalar or an array - scalar (an instance of a sub- type of :cdata:`PyGenericArr_Type` ). + Evaluates true if *op* is either a Python scalar object (see + :cfunc:`PyArray_IsPythonScalar`) or an array scalar (an instance of a sub- + type of :cdata:`PyGenericArr_Type` ). + +.. cfunction:: PyArray_CheckAnyScalar(op) + + Evaluates true if *op* is a Python scalar object (see + :cfunc:`PyArray_IsPythonScalar`), an array scalar (an instance of a + sub-type of :cdata:`PyGenericArr_Type`) or an instance of a sub-type of + :cdata:`PyArray_Type` whose dimensionality is 0. Data-type checking @@ -2519,6 +2532,8 @@ Array Scalars .. cfunction:: PyObject* PyArray_Return(PyArrayObject* arr) + This function steals a reference to *arr*. + This function checks to see if *arr* is a 0-dimensional array and, if so, returns the appropriate array scalar. It should be used whenever 0-dimensional arrays could be returned to Python. |