Pure Python Bit Array
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bit_array
test
.travis.yml
LICENSE
README.md
setup.py

README.md

Bit Array

Travis CI License

A simple bit array in pure python. Sample use:

b = BitArray(64)
b[0] = 1
b[1] = 0

You can also initialize with a list:

b = BitArray([0,1,0,1,0,1,0,1])
print(b[1])
>>> 1

You can also access parts of the array with slice operations:

sliced = b[0:4]
print(sliced[1])
>> 1
len(sliced)
>>> 4