Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 526 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 526 Bytes

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