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

Fix ArrayProxy shape for signed numbers #486

Closed
wants to merge 1 commit into from

Conversation

pepijndevos
Copy link
Contributor

fixes #476

This time for real hopefully. Any edge cases I forgot?

@whitequark
Copy link
Member

whitequark commented Aug 26, 2020

I had a hard time convincing myself that the new logic in this PR is correct, so eventually I rewrote it in 00026c6, hopefully more clearly. I did use your tests though; thanks!

@whitequark whitequark closed this Aug 26, 2020
@pepijndevos
Copy link
Contributor Author

Clarity is in the eye of the beholder apparently haha
My brain seems to be wired in a more functional programming way than is usually considered Pythonic I guess.
I tend to favour complex list comprehensions over for loops that touch 4 variables.
Glad it's fixed either way :)

@whitequark
Copy link
Member

Clarity is in the eye of the beholder apparently haha
My brain seems to be wired in a more functional programming way than is usually considered Pythonic I guess.

It's mostly the use of arithmetic operations on bools (which most functional languages I know don't allow). The original code that I wrote did it, and that was pretty confusing (I think you actually got confused at first). I had to read it a few times to convince myself that it's correct, so I thought I might as well rewrite it.

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

Successfully merging this pull request may close these issues.

ArrayProxy shape does not equal element shape for a homogeneous array of signed values
2 participants