Closed
Description
Is the fact that 1:3 != collect(1:3)
intended? I can see in the definition of ==
that comparisons between Range
and Array
are explicitly handled to return false
, but I can't find a good reason for that.
julia> x = 1:3
1:3
julia> y = collect(x)
3-element Array{Int64,1}:
1
2
3
julia> x == y
false
# And yet:
julia> all(Bool[i == j for (i, j) in zip(x, y)])
true
help?> ==
[...]
Collections should generally implement == by calling == recursively on all
contents.
[...]
Metadata
Metadata
Assignees
Labels
No labels