Skip to content
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

bits[key] for negative key seems to not behave correctly #244

Closed
blazra opened this issue Dec 10, 2020 · 0 comments · Fixed by #245
Closed

bits[key] for negative key seems to not behave correctly #244

blazra opened this issue Dec 10, 2020 · 0 comments · Fixed by #245
Labels
software Component: software

Comments

@blazra
Copy link
Contributor

blazra commented Dec 10, 2020

Consider:

>>> from glasgow.support.bits import bits
>>> some = bits("10001001011")
>>> some[-1]
0
>>> some[-2]
0
>>> some[-5]
0

I think that for some[-1] you should get the most significant bit. For some[-2] the second most significant bit and so on...

It looks like an easy fix in support/bits.py - I will make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
software Component: software
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants