diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index f646957a6..1f90dba87 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -3520,17 +3520,16 @@ ufunc_generic_call(PyUFuncObject *self, PyObject *args, PyObject *kwds) } if (errval == -1) return NULL; - else { - /* - * PyErr_SetString(PyExc_TypeError,""); - * return NULL; - */ - /* This is expected by at least the ndarray rich_comparisons - to allow for additional handling for strings. - */ + else if (self->nin == 2 && self->nout == 1) { + /* To allow the other argument to be given a chance + */ Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } + else { + PyErr_SetString(PyExc_NotImplementedError, "Not implemented for this type"); + return NULL; + } } for (i = 0; i < self->nin; i++) { Py_DECREF(mps[i]); |