How to use a 5 or 6 bit integer in Python?

Oren Tirosh oren-py-l at hishome.net
Sat Dec 20 08:21:27 EST 2003


On Fri, Dec 19, 2003 at 06:26:22PM +1100, Glen Wheeler wrote:
....
> tuple of integers as it's data type.  All integers are from 0-63.
>   For the second dict:  Trivially small, with a maximum of 32
> elements, starts at 0 and an average of around 7.  Keys are kept as
> integers from 0-63 and data ranges from -1-30, i

It's your lucky day... All your integers are from -1 to 63 which fits
nicely in Python's range of "privileged" integers from -1 to 100.
These are handled much faster by using a static table of integer 
objects without the overhead of allocation and deallocatiom. 

    Oren





More information about the Python-list mailing list