summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-17 15:33:18 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-17 15:33:18 (GMT)
commit6fd867b04d78766700af1ca4cfc9cba1782a1519 (patch)
tree383001b8510dd0d7347daa3d48af3795baa03149
parent3968e4c0f5fc95242c85d7164f6fcea881b320f9 (diff)
downloadcpython-6fd867b04d78766700af1ca4cfc9cba1782a1519.zip
cpython-6fd867b04d78766700af1ca4cfc9cba1782a1519.tar.gz
cpython-6fd867b04d78766700af1ca4cfc9cba1782a1519.tar.bz2
Rich comparisons fall-out:
- Get rid of long_cmp(). - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.
-rw-r--r--Objects/longobject.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index fb6d78e..e762665 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -966,19 +966,6 @@ long_compare(PyLongObject *a, PyLongObject *b)
return sign < 0 ? -1 : sign > 0 ? 1 : 0;
}
-/* Needed for the new style number compare slots */
-static PyObject *
-long_cmp(PyObject *v, PyObject *w)
-{
- PyLongObject *a, *b;
- int c;
- CONVERT_BINOP(v, w, &a, &b);
- c = long_compare(a, b);
- Py_DECREF(a);
- Py_DECREF(b);
- return PyInt_FromLong(c);
-}
-
static long
long_hash(PyLongObject *v)
{
@@ -1860,9 +1847,6 @@ static PyNumberMethods long_as_number = {
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
-
- /* New style slots */
- (binaryfunc) long_cmp, /*nb_cmp*/
};
PyTypeObject PyLong_Type = {
@@ -1886,5 +1870,5 @@ PyTypeObject PyLong_Type = {
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
- Py_TPFLAGS_NEWSTYLENUMBER /*tp_flags*/
+ Py_TPFLAGS_CHECKTYPES /*tp_flags*/
};