[Python-3000] C API for ints and strings
Guido van Rossum
guido at python.org
Sat Sep 8 19:29:09 CEST 2007
Hm, then perhaps rangeobject.c shouldn't use it?
On 9/8/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> >> Why is _PyLong_FitsInLong private?
> >
> > I don't know; perhaps because it doesn't always give the best answer.
>
> Its sole purpose is to support PyInt_CheckExact. There is some code
> that relies that after PyInt_CheckExact succeeds, it is safe to do
> PyInt_AsLong. When I defined PyInt_CheckExact to PyLong_CheckExact,
> such code would break. Adding this "conservative" estimate allowed
> that code to work when the macro was true. As this occurs in some
> time-critical places, I did not want to waste time with computing a
> correct result.
>
> Regards,
> Martin
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list