-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement support for condensed bit masks #382
Conversation
IMO this is a somewhat exotic feature... Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com> Signed-off-by: Michael Hahn <michael.hahn@mbition.io>
Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com>
|
||
# TODO: this is pretty slow. replace it by | ||
# `self.bit_mask.bit_count()` once we require python >= | ||
# 3.10. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not that far away from 3.9 end of life, you may drop it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I promised myself to support python 3.8 until ubuntu 20.04 is EOL. Fortunately, this is not too far off anymore (April), then we can do the same for Ubuntu 22.04 / python 3.10. I've added an item to the TODO list, though: #286 . (That said, I suspect that the performance impact of converting the integer to a string and counting the one characters is lower than the interpreter overhead of doing two instead of one function calls. For compiled languages this is a completely different story...)
this basically means using `isinstance(*, SupportsBytes)` instead of `isinstance(*, bytes)`. Interestingly enough, `isinstance(bytearray(), SupportsBytes)` is `False`, so we have to explicitly check for `bytearray` as well. thanks to [at]kayoub5 for the catch! Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com>
e4d7724
to
5b2b0d9
Compare
IMO this is a somewhat exotic feature, but since it is in the spec there probably is somebody out there who uses it...
Andreas Lauser <andreas.lauser@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information