Commits

Tim Peters  committed fc1680f

SF bug #439104: Tuple richcompares has code-typo.
Symptom: (1, 2, 3) <= (1, 2) returned 1.
Also an isomorphic error was in the list richcompare code.

  • Participants
  • Parent commits 9512747
  • Branches 2.1

Comments (0)

Files changed (2)

File Objects/listobject.c

 		PyObject *res;
 		switch (op) {
 		case Py_LT: cmp = vs <  ws; break;
-		case Py_LE: cmp = ws <= ws; break;
+		case Py_LE: cmp = vs <= ws; break;
 		case Py_EQ: cmp = vs == ws; break;
 		case Py_NE: cmp = vs != ws; break;
 		case Py_GT: cmp = vs >  ws; break;

File Objects/tupleobject.c

 		PyObject *res;
 		switch (op) {
 		case Py_LT: cmp = vs <  ws; break;
-		case Py_LE: cmp = ws <= ws; break;
+		case Py_LE: cmp = vs <= ws; break;
 		case Py_EQ: cmp = vs == ws; break;
 		case Py_NE: cmp = vs != ws; break;
 		case Py_GT: cmp = vs >  ws; break;