summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-17 15:33:42 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-17 15:33:42 (GMT)
commitf916e7aa6281ce82155eebf06b6b21d48e07ce39 (patch)
tree67cdcf7325570c9820a8a1e6b0f83cfcdfadef5a /Objects/floatobject.c
parent6fd867b04d78766700af1ca4cfc9cba1782a1519 (diff)
downloadcpython-f916e7aa6281ce82155eebf06b6b21d48e07ce39.zip
cpython-f916e7aa6281ce82155eebf06b6b21d48e07ce39.tar.gz
cpython-f916e7aa6281ce82155eebf06b6b21d48e07ce39.tar.bz2
Rich comparisons fall-out:
- Get rid of float_cmp(). - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 3e87903..5e646b9 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -346,16 +346,6 @@ float_compare(PyFloatObject *v, PyFloatObject *w)
return (i < j) ? -1 : (i > j) ? 1 : 0;
}
-/* Needed for the new style number compare slots */
-static PyObject *
-float_cmp(PyObject *v, PyObject *w)
-{
- double a,b;
- CONVERT_TO_DOUBLE(v, a);
- CONVERT_TO_DOUBLE(w, b);
- return PyInt_FromLong((a < b) ? -1 : (a > b) ? 1 : 0);
-}
-
static long
float_hash(PyFloatObject *v)
{
@@ -670,9 +660,6 @@ static PyNumberMethods float_as_number = {
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
-
- /* New style slots: */
- (binaryfunc)float_cmp, /*nb_cmp*/
};
PyTypeObject PyFloat_Type = {
@@ -696,7 +683,7 @@ PyTypeObject PyFloat_Type = {
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
- Py_TPFLAGS_NEWSTYLENUMBER /*tp_flags*/
+ Py_TPFLAGS_CHECKTYPES /*tp_flags*/
};
void