Merge branch changes (coercion, rich comparisons) into trunk.

This commit is contained in:
Guido van Rossum 2001-09-27 20:30:07 +00:00
parent 33f4d6d1db
commit 2ed6bf87c9
4 changed files with 106 additions and 11 deletions

View file

@ -824,10 +824,8 @@ string_richcompare(PyStringObject *a, PyStringObject *b, int op)
int min_len;
PyObject *result;
/* May sure both arguments use string comparison.
This implies PyString_Check(a) && PyString_Check(b). */
if (a->ob_type->tp_richcompare != (richcmpfunc)string_richcompare ||
b->ob_type->tp_richcompare != (richcmpfunc)string_richcompare) {
/* Make sure both arguments are strings. */
if (!(PyString_Check(a) && PyString_Check(b))) {
result = Py_NotImplemented;
goto out;
}