I am using a BitArray in my python script, and I was wondering if there is a way to change the indexes order of the BitArray that I create. Right now the indexes are from 0 to N-1 where N is the number of bits. Is there away to change the indexes to go from N-1 to O?
dataBits = BitArray('0b10100000')
print(dataBits[0])
This above two lines return the first bit True because the order of indexes is from 0 to N-1. Can I change the order of indexes for this to return the last bit False?
TrueorFalse?BitArray? IE:dataBits = BitArray('10100000'[::-1])? Otherwise, you should subclass and implement your own__getitem__and__iter__methods. The first is preferable since there might be other methods inBitArraythat depend on the order and might lead to "unexpected" behavior. Also, where is the documentation for theBitArraylibrary you're using?