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

support.bits: fix __getitem__ for negative keys #245

Merged
merged 1 commit into from Dec 10, 2020
Merged

support.bits: fix __getitem__ for negative keys #245

merged 1 commit into from Dec 10, 2020

Conversation

blazra
Copy link
Contributor

@blazra blazra commented Dec 10, 2020

I think you want to subtract absolute value of key from _len_, but with _len_ - key you get _len_ added to the absolute value of key.
So I propose changing the sign in the expression.

Fixes #244

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch!

@whitequark whitequark merged commit 047ed15 into GlasgowEmbedded:master Dec 10, 2020
@blazra blazra deleted the patch-1 branch December 10, 2020 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bits[key] for negative key seems to not behave correctly
2 participants