summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-17 15:29:42 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-17 15:29:42 (GMT)
commitc31896960a24202bd972e8c79d288cd3a80fac94 (patch)
treed4fc0b7d30c31a360b4dce829a38f723e43f5bc7 /Objects
parent8998b4f691db9bf1efcdd1fd496aaea64200a957 (diff)
downloadcpython-c31896960a24202bd972e8c79d288cd3a80fac94.zip
cpython-c31896960a24202bd972e8c79d288cd3a80fac94.tar.gz
cpython-c31896960a24202bd972e8c79d288cd3a80fac94.tar.bz2
Rich comparisons fall-out:
- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES. - Use PyObject_RichCompareBool() in PySequence_Contains().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 9050a4c..1189ae8 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -6,7 +6,7 @@
#include "structmember.h" /* we need the offsetof() macro from there */
#define NEW_STYLE_NUMBER(o) PyType_HasFeature((o)->ob_type, \
- Py_TPFLAGS_NEWSTYLENUMBER)
+ Py_TPFLAGS_CHECKTYPES)
/* Shorthands to return certain errors */
@@ -1363,11 +1363,11 @@ PySequence_Contains(PyObject *w, PyObject *v) /* v in w */
}
return -1;
}
- cmp = PyObject_Compare(v, x);
+ cmp = PyObject_RichCompareBool(v, x, Py_EQ);
Py_XDECREF(x);
- if (cmp == 0)
+ if (cmp > 0)
return 1;
- if (PyErr_Occurred())
+ if (cmp < 0)
return -1;
}