Bit arrays.

Terry Reedy tjreedy at
Sat Feb 12 03:59:37 CET 2000

"Emile van Sebille" <emile at> wrote in message
news:06c201bf7441$9b05ad40$01ffffc0 at
> I often set 'bit' style flags in integers, but leave them as
> integers.  e.g., add 2^5+2^3+2^2 to an int to turn on bits
> 5,3,2 (or 4,2,1)

Except when starting from 0, you need to 'or' the bits to set them, not add.

More information about the Python-list mailing list