[Python-Dev] Re: [Patches] make 'b','h','i' raise overflow exception

Guido van Rossum guido@python.org
Tue, 09 May 2000 06:48:16 -0400


> An alternative would be to promote the size member from int to size_t;
> that's no actual change on the 32-bit machines Guido generally assumes
> without realizing it, and removes an arbitrary (albeit defensible)
> limitation on some 64-bit machines at the cost of (just possibly, due to
> alignment vagaries) boosting var objects' header size on the latter.

Then the signatures of many, many functions would have to be changed
to take or return size_t, too -- almost anything in the Python/C API
that *conceptually* is a size_t is declared as int; the ob_size field
is only the tip of the iceberg.

We'd also have to change the size of Python ints (currently long) to
an integral type that can hold a size_t; on Windows (and I believe
*only* on Windows) this is a long long, or however they spell it
(except size_t is typically unsigned).

This all is a major reworking -- not good for 1.6, even though I agree
it needs to be done eventually.

--Guido van Rossum (home page: http://www.python.org/~guido/)