diff options
author | Frederic <nouiz@nouiz.org> | 2013-05-15 11:59:34 -0400 |
---|---|---|
committer | Frederic <nouiz@nouiz.org> | 2013-05-15 11:59:34 -0400 |
commit | 3a09d96c9e95f56c1ce31d328a93c9dc4e2bc909 (patch) | |
tree | b29bf4c52c4d49186f5b29cad449b853870e619a /numpy | |
parent | aa7a04741146c44ab1735782a89a60b038028bf2 (diff) | |
download | numpy-3a09d96c9e95f56c1ce31d328a93c9dc4e2bc909.tar.gz |
Revert "Make comparison function (gt, ge, ...) respect __array_priority__."
This reverts commit aa7a04741146c44ab1735782a89a60b038028bf2.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/arrayobject.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c index 1c8c4803f..ad196e010 100644 --- a/numpy/core/src/multiarray/arrayobject.c +++ b/numpy/core/src/multiarray/arrayobject.c @@ -1266,50 +1266,6 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op) PyObject *result = NULL; PyArray_Descr *dtype = NULL; - // If other is of different type and the type priority is higher - // use its comparison function. - if (Py_TYPE(other) != Py_TYPE(self)) { - double prior1, prior2; - prior2 = PyArray_GetPriority((PyObject *)other, 0.0); - prior1 = PyArray_GetPriority((PyObject *)self, 0.0); - if (prior2 > prior1) { - PyObject *attr; - char * str = NULL; - switch (cmp_op) { - case Py_LT: - str = "__gt__"; - break; - case Py_LE: - str = "__ge__"; - break; - case Py_EQ: - str = "__eq__"; - break; - case Py_NE: - str = "__ne__"; - break; - case Py_GT: - str = "__lt__"; - break; - case Py_GE: - str = "__le__"; - break; - } - - if (str != NULL) { - attr = PyObject_GetAttrString(other, str); - - if (attr != NULL && PyCallable_Check(attr)) { - PyObject * ret; - ret = PyObject_CallFunctionObjArgs(attr, (PyObject *)self, NULL); - Py_DECREF(attr); - return ret; - } - Py_XDECREF(attr); - } - } - } - switch (cmp_op) { case Py_LT: result = PyArray_GenericBinaryFunction(self, other, |