for the read and readlist methods (and related ones) there was a default type of uint introduced back in 2009. This doesn't appear to have been consistently applied though:
>>> s = BitStream('0x1100')
>>> s.read('4')
1
>> s.read(4)
BitStream('0x1')
You do have the options of using s.read('bits:4') if you want a new bitstring, but not having uint as a special case is a cleaner interface.
I think the best course is to remove the uint default interpretation and return a bitstring in both cases. It's a breaking change though so will have to wait for 3.2. Docs need updating too.
for the read and readlist methods (and related ones) there was a default type of
uint
introduced back in 2009. This doesn't appear to have been consistently applied though:You do have the options of using
s.read('bits:4')
if you want a new bitstring, but not having uint as a special case is a cleaner interface.I think the best course is to remove the uint default interpretation and return a bitstring in both cases. It's a breaking change though so will have to wait for 3.2. Docs need updating too.