Kaydet (Commit) fb50d3ff authored tarafından Guido van Rossum's avatar Guido van Rossum

default_3way_compare(): use PyNumber_Check(), rather than testing for

tp_as_number directly.
üst 6921eca2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment