mirror of
https://github.com/python/cpython
synced 2026-09-28 07:38:20 +03:00
The opstrings table was backwards. Add an XXX comment.
This commit is contained in:
parent
66a796e5ab
commit
9a4e95ccc8
1 changed files with 2 additions and 1 deletions
|
|
@ -619,7 +619,7 @@ PyObject_Compare(PyObject *v, PyObject *w)
|
||||||
/* Map rich comparison operators to their swapped version, e.g. LT <--> GT */
|
/* 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};
|
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
|
/* Perform a rich comparison, raising TypeError when the requested comparison
|
||||||
operator is not supported. */
|
operator is not supported. */
|
||||||
|
|
@ -659,6 +659,7 @@ do_richcompare(PyObject *v, PyObject *w, int op)
|
||||||
res = (v != w) ? Py_True : Py_False;
|
res = (v != w) ? Py_True : Py_False;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
/* XXX Special-case None so it doesn't show as NoneType() */
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"unorderable types: %.100s() %s %.100s()",
|
"unorderable types: %.100s() %s %.100s()",
|
||||||
v->ob_type->tp_name,
|
v->ob_type->tp_name,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue