Merged the int/long unification branch, by very crude means (sorry Thomas!).
I banged on the code (beyond what's in that branch) to make fewer tests fail;
the only tests that fail now are:
test_descr -- can't pickle ints?!
test_pickletools -- ???
test_socket -- See python.org/sf/1619659
test_sqlite -- ???
I'll deal with those later.
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 9c6dadf..514dd39 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -273,10 +273,7 @@
{
register PyObject *obj = *v;
- if (PyInt_Check(obj)) {
- *dbl = (double)PyInt_AS_LONG(obj);
- }
- else if (PyLong_Check(obj)) {
+ if (PyLong_Check(obj)) {
*dbl = PyLong_AsDouble(obj);
if (*dbl == -1.0 && PyErr_Occurred()) {
*v = NULL;
@@ -376,32 +373,6 @@
goto Unimplemented;
}
- else if (PyInt_Check(w)) {
- long jj = PyInt_AS_LONG(w);
- /* In the worst realistic case I can imagine, C double is a
- * Cray single with 48 bits of precision, and long has 64
- * bits.
- */
-#if SIZEOF_LONG > 6
- unsigned long abs = (unsigned long)(jj < 0 ? -jj : jj);
- if (abs >> 48) {
- /* Needs more than 48 bits. Make it take the
- * PyLong path.
- */
- PyObject *result;
- PyObject *ww = PyLong_FromLong(jj);
-
- if (ww == NULL)
- return NULL;
- result = float_richcompare(v, ww, op);
- Py_DECREF(ww);
- return result;
- }
-#endif
- j = (double)jj;
- assert((long)j == jj);
- }
-
else if (PyLong_Check(w)) {
int vsign = i == 0.0 ? 0 : i < 0.0 ? -1 : 1;
int wsign = _PyLong_Sign(w);