Equality of empty ranges

In order to be equal, ranges need to have the same first element, last element, and step, even if they are empty. In my opinion, this is unintuitive:

julia> 2:1 == 1:0
false

It also breaks the transitivity of ==:

julia> 2:1 == Int[] == 1:0
true

Is this behavior intentional? (And if it is, what is the intention?)

That does seem like a bit of a problem; could you open a GitHub issue?

I have opened an issue:

https://github.com/JuliaLang/julia/issues/29421

1 Like

Thank you!