]> granicus.if.org Git - python/commitdiff
The opstrings table was backwards. Add an XXX comment.
authorGuido van Rossum <guido@python.org>
Tue, 19 Dec 2006 21:35:46 +0000 (21:35 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 19 Dec 2006 21:35:46 +0000 (21:35 +0000)
Objects/object.c

index 4d9f414ffc8440d759f99a1021bb6e47b6cccda2..c07a369e13a21e5365ef03669db5a9b239af9540 100644 (file)
@@ -619,7 +619,7 @@ PyObject_Compare(PyObject *v, PyObject *w)
 /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */
 int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE};
 
-static char *opstrings[] = {">", ">=", "==", "!=", "<", "<="};
+static char *opstrings[] = {"<", "<=", "==", "!=", ">", ">="};
 
 /* Perform a rich comparison, raising TypeError when the requested comparison
    operator is not supported. */
@@ -659,6 +659,7 @@ do_richcompare(PyObject *v, PyObject *w, int op)
                res = (v != w) ? Py_True : Py_False;
                break;
        default:
+               /* XXX Special-case None so it doesn't show as NoneType() */
                PyErr_Format(PyExc_TypeError,
                             "unorderable types: %.100s() %s %.100s()",
                             v->ob_type->tp_name,