At first glance, the Python BitVector module sounds as if it does exactly what you want. It is available at http://cobweb.ecn.purdue.edu/~kak/dist/BitVector-1.5.1.html , and since it is pure Python code, it will work on any platform without compilation.
You mentioned that you need a certain speed to get and set any arbitrary true-false value. To do this, you need to use a Python array, not a list, and if you go to the above URL and look at the source code for BitVector, you will see that it really relies on Python arrays.
Ideally, you should encapsulate what you are doing in a class that subclasses from BitVector, i.e.
class TFValues(BitVector): pass
That way, you can do things like adding a list to contain related information, such as the name of a specific TF value.
Michael dillon
source share