mirror of
https://github.com/python/cpython.git
synced 2025-09-01 22:47:59 +00:00
Merge branch changes (coercion, rich comparisons) into trunk.
This commit is contained in:
parent
33f4d6d1db
commit
2ed6bf87c9
4 changed files with 106 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue