summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-01-19 16:59:19 -0800
committerEric Wieser <wieser.eric@gmail.com>2019-01-19 16:59:19 -0800
commit9c2296b242be4fe2fce46daf06a1e360ec267a08 (patch)
tree2ac248367716878e3d426a98776d0d822abc657c
parentf4f3fa757c6a3ce498ea04a1bb0cbf7634be1d57 (diff)
downloadnumpy-9c2296b242be4fe2fce46daf06a1e360ec267a08.tar.gz
DOC: Explain -1 return values
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index 8abc6ac7c..b26870b3c 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -67,6 +67,9 @@ npy_casting_to_string(NPY_CASTING casting)
}
}
+/**
+ * Always returns -1 to indicate the exception was raised, for convenience
+ */
static int
raise_binary_type_reso_error(PyUFuncObject *ufunc, PyArrayObject **operands) {
PyObject *errmsg;
@@ -84,7 +87,9 @@ raise_binary_type_reso_error(PyUFuncObject *ufunc, PyArrayObject **operands) {
return -1;
}
-/** Helper function to raise UFuncNoLoopError */
+/** Helper function to raise UFuncNoLoopError
+ * Always returns -1 to indicate the exception was raised, for convenience
+ */
static int
raise_no_loop_found_error(
PyUFuncObject *ufunc, PyArray_Descr **dtypes, npy_intp n_dtypes)
@@ -157,7 +162,9 @@ raise_casting_error(
return -1;
}
-/** Helper function to raise UFuncInputCastingError */
+/** Helper function to raise UFuncInputCastingError
+ * Always returns -1 to indicate the exception was raised, for convenience
+ */
static int
raise_input_casting_error(
PyUFuncObject *ufunc,
@@ -178,7 +185,9 @@ raise_input_casting_error(
}
-/** Helper function to raise UFuncOutputCastingError */
+/** Helper function to raise UFuncOutputCastingError
+ * Always returns -1 to indicate the exception was raised, for convenience
+ */
static int
raise_output_casting_error(
PyUFuncObject *ufunc,