[pypy-commit] pypy py3k: tp_compare is gone in py3, kill

pjenvey noreply at buildbot.pypy.org
Sat Apr 13 00:26:57 CEST 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r63297:5ea602d6bb08
Date: 2013-04-12 15:26 -0700
http://bitbucket.org/pypy/pypy/changeset/5ea602d6bb08/

Log:	tp_compare is gone in py3, kill

diff --git a/pypy/module/cpyext/test/comparisons.c b/pypy/module/cpyext/test/comparisons.c
--- a/pypy/module/cpyext/test/comparisons.c
+++ b/pypy/module/cpyext/test/comparisons.c
@@ -73,23 +73,6 @@
 };
 
 
-static int cmp_compare(PyObject *self, PyObject *other) {
-    return -1;
-}
-
-PyTypeObject OldCmpType = {
-    PyVarObject_HEAD_INIT(NULL, 0)
-    "comparisons.OldCmpType",                       /* tp_name */
-    sizeof(CmpObject),                              /* tp_basicsize */
-    0,                                              /* tp_itemsize */
-    0,                                              /* tp_dealloc */
-    0,                                              /* tp_print */
-    0,                                              /* tp_getattr */
-    0,                                              /* tp_setattr */
-    (cmpfunc)cmp_compare,                           /* tp_compare */
-};
-
-
 static struct PyModuleDef moduledef = {
     PyModuleDef_HEAD_INIT,
     "comparisons",
@@ -105,8 +88,6 @@
 
     if (PyType_Ready(&CmpType) < 0)
         return NULL;
-    if (PyType_Ready(&OldCmpType) < 0)
-        return NULL;
     m = PyModule_Create(&moduledef);
     if (m == NULL)
         return NULL;
@@ -115,7 +96,5 @@
         return NULL;
     if (PyDict_SetItemString(d, "CmpType", (PyObject *)&CmpType) < 0)
         return NULL;
-    if (PyDict_SetItemString(d, "OldCmpType", (PyObject *)&OldCmpType) < 0)
-        return NULL;
     return m;
 }
diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -217,11 +217,6 @@
 
         assert cmpr.__le__(4) is NotImplemented
 
-    def test_tpcompare(self):
-        module = self.import_module("comparisons")
-        cmpr = module.OldCmpType()
-        assert cmpr < cmpr
-
     def test_hash(self):
         module = self.import_module("comparisons")
         cmpr = module.CmpType()


More information about the pypy-commit mailing list