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

Equality of empty OffsetArrays changes in Julia 1.5 #111

Open
mbauman opened this issue May 5, 2020 · 2 comments
Open

Equality of empty OffsetArrays changes in Julia 1.5 #111

mbauman opened this issue May 5, 2020 · 2 comments

Comments

@mbauman
Copy link
Member

mbauman commented May 5, 2020

Previously, empty arrays with different offsets compared as different because their axes compared as different.

In Julia master (JuliaLang/julia#32348), empty ranges are now equal, making OffsetArray([],-1) == OffsetArray([], -2).

I'm not sure what the right semantic is here; I believe this was untested in the entire ecosystem.

@StefanKarpinski
Copy link

Would be great to get feedback on this now while we can still revert the change before 1.5 if it turns out to be a Bad Thing.

@timholy
Copy link
Member

timholy commented May 5, 2020

As I commented there, I don't know the answer.

But here's a way of thinking about it: an OffsetArray is really just an optimized representation of an ordered dict, with index=>value pairs. When the container is empty, there are no pairs, so of course two such dicts are the same.

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

No branches or pull requests

3 participants