[Python-3000] C API for ints and strings (original) (raw)

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 PyLongFitsInLong private? > > I don't know; perhaps because it doesn't always give the best answer.

Its sole purpose is to support PyIntCheckExact. There is some code that relies that after PyIntCheckExact succeeds, it is safe to do PyIntAsLong. When I defined PyIntCheckExact to PyLongCheckExact, 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