[Python-Dev] Optimization of the Year

Guido van Rossum guido at python.org
Wed Feb 11 12:12:42 EST 2004


> I still plan to introduce size_t/ssize_t as the data type for element
> counts in sequences. This will cause severe ABI incompatibilities on
> 64-bit systems (while causing no change on 32-bit systems).

I'm all for this.  I imagine there are many subtleties though -- I
know I consciously chose 'int' for this purpose in Python 0, and the
assumption that it fits in an int is everywhere.  I would trust a
decent compiler to find most cases, but not all.

I alsoam not sure there are no incompatibilities on 32-bit systems --
the interpretation of certain bit patterns will be different.

Also, occasionally (size_t)(-1) may be used to indicate an error
(e.g. PySequence_Size()).

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



More information about the Python-Dev mailing list