Mark Dickinson <dicki...@gmail.com> added the comment: Alexander, I think it should be as simple as replacing the if (!PyInt_Check(ilow) && ...) block with something like this:
if (!PyInt_Check(ilow) && !PyLong_Check(ilow)) { PyNumberMethods *nb = Py_TYPE(ilow)->tp_as_number; PyObject *temp; if (PyFloat_Check(ilow) || nb == NULL || nb->nb_int == NULL) { PyErr_Format(PyExc_TypeError, "range() integer start argument expected, got %s.", ilow->ob_type->tp_name); goto Fail; } temp = (*nb->nb_int)(ilow); Py_DECREF(ilow); ilow = temp; if (temp == NULL) goto Fail; } and then doing the same for the ihigh and istep blocks. But I haven't tested this. Mark ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1533> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com