Closed prauscher closed 7 months ago
Just to confirm: Prior to d9beb0d the inherited Bits.__getitem__
was used, which has such overloads specified: https://github.com/scott-griffiths/bitstring/blob/main/bitstring/bits.py#L223
Hi. Thanks for bug report and the kind words. I don't think I can reproduce the issue you're having but different tools have different requirements for static typing and the library does do some stuff that annoys a few of them!
But you're definitely right that the overloads should have been added as they have been elsewhere. I'll make the change for the 4.2.1 release which will hopefully fix the issue for you.
Thanks.
I've made the suggested additional overloads in the 4.2.1 release, so hopefully that will help.
Hello,
First of all thank you for this library, which makes it a real breeze to work with nifty Bit-oriented protocols. Sadly we encoutered a problem related to static typing with the latest 4.2.0 release:
Prior to 4.2.0 (specifically 4.1.4 which we were using) slicing a BitStream resulted in a new BitStream (typing-wise):
probably due with commit d9beb0d3 slicing got a new method, which always returns
Union[TBits, bool]
. Static typing therefore yields to errors likeItem "bool" of "Any | bool" has no attribute "uint"
. Probably a typing-overloads such ascould help already? Happy to help with a PR if you like.