[Python-checkins] r67876 - in python/branches/py3k-issue1717: Include/object.h Objects/object.c

mark.dickinson python-checkins at python.org
Sat Dec 20 15:41:15 CET 2008


Author: mark.dickinson
Date: Sat Dec 20 15:41:15 2008
New Revision: 67876

Log:
Remove Py_CmpToRich, now that it's no longer used anywhere.


Modified:
   python/branches/py3k-issue1717/Include/object.h
   python/branches/py3k-issue1717/Objects/object.c

Modified: python/branches/py3k-issue1717/Include/object.h
==============================================================================
--- python/branches/py3k-issue1717/Include/object.h	(original)
+++ python/branches/py3k-issue1717/Include/object.h	Sat Dec 20 15:41:15 2008
@@ -425,7 +425,6 @@
 PyAPI_FUNC(PyObject *) PyObject_Bytes(PyObject *);
 PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int);
 PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int);
-PyAPI_FUNC(PyObject *) Py_CmpToRich(int op, int cmp);
 PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
 PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *);
 PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);

Modified: python/branches/py3k-issue1717/Objects/object.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/object.c	(original)
+++ python/branches/py3k-issue1717/Objects/object.c	Sat Dec 20 15:41:15 2008
@@ -626,44 +626,6 @@
 	return ok;
 }
 
-/* Turn the result of a three-way comparison into the result expected by a
-   rich comparison. */
-PyObject *
-Py_CmpToRich(int op, int cmp)
-{
-	PyObject *res;
-	int ok;
-
-	if (PyErr_Occurred())
-		return NULL;
-	switch (op) {
-	case Py_LT:
-		ok = cmp <  0;
-		break;
-	case Py_LE:
-		ok = cmp <= 0;
-		break;
-	case Py_EQ:
-		ok = cmp == 0;
-		break;
-	case Py_NE:
-		ok = cmp != 0;
-		break;
-	case Py_GT:
-		ok = cmp >  0;
-		break;
-	case Py_GE:
-		ok = cmp >= 0;
-		break;
-	default:
-		PyErr_BadArgument();
-		return NULL;
-	}
-	res = ok ? Py_True : Py_False;
-	Py_INCREF(res);
-	return res;
-}
-
 /* Set of hash utility functions to help maintaining the invariant that
 	if a==b then hash(a)==hash(b)
 


More information about the Python-checkins mailing list