From fb50d3ffa13a6fadd69da358869028cade89d3ca Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 18 Feb 2003 16:40:09 +0000 Subject: default_3way_compare(): use PyNumber_Check(), rather than testing for tp_as_number directly. --- Objects/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Objects/object.c b/Objects/object.c index 150caac..10877b5 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -633,12 +633,12 @@ default_3way_compare(PyObject *v, PyObject *w) if (w == Py_None) return 1; - /* different type: compare type names */ - if (v->ob_type->tp_as_number) + /* different type: compare type names; numbers are smaller */ + if (PyNumber_Check(v)) vname = ""; else vname = v->ob_type->tp_name; - if (w->ob_type->tp_as_number) + if (PyNumber_Check(w)) wname = ""; else wname = w->ob_type->tp_name; -- cgit v0.12