Return a NotImplemented exception when comparing Matrix or Vector with other types
This commit is contained in:
@@ -159,8 +159,9 @@ PyObject* MatrixPy::richCompare(PyObject *v, PyObject *w, int op)
|
||||
}
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Cannot compare Matrix with other type");
|
||||
return 0;
|
||||
// This always returns False
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user