Message104747
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 |
|
Date |
User |
Action |
Args |
2010-05-01 20:21:15 | mark.dickinson | set | recipients:
+ mark.dickinson, loewis, rhettinger, belopolsky, christian.heimes, josm, robertwb, zanella, akitada |
2010-05-01 20:21:15 | mark.dickinson | set | messageid: <1272745275.02.0.869946146863.issue1533@psf.upfronthosting.co.za> |
2010-05-01 20:21:13 | mark.dickinson | link | issue1533 messages |
2010-05-01 20:21:13 | mark.dickinson | create | |
|