summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-02-18 16:40:09 (GMT)
committerGuido van Rossum <guido@python.org>2003-02-18 16:40:09 (GMT)
commitfb50d3ffa13a6fadd69da358869028cade89d3ca (patch)
tree7642a43df9a2a81bc0486c980d306d39de3a0a51 /Objects
parent6921eca227ac2283ebcdf98e10aebea57bd5daf3 (diff)
downloadcpython-fb50d3ffa13a6fadd69da358869028cade89d3ca.zip
cpython-fb50d3ffa13a6fadd69da358869028cade89d3ca.tar.gz
cpython-fb50d3ffa13a6fadd69da358869028cade89d3ca.tar.bz2
default_3way_compare(): use PyNumber_Check(), rather than testing for
tp_as_number directly.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c6
1 files 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;