Open mtfishman opened 2 years ago
I don't have 1.7 installed, but I'm curious what you get for this:
julia> setdiff([1,2,3], Float64[1,2,3.1], ['a', 'b', 'c'])
1-element Vector{Any}:
3
On Julia 1.7 I get:
julia> setdiff([1,2,3], Float64[1,2,3.1], ['a', 'b', 'c'])
1-element Vector{Int64}:
3
and on Julia 1.8 I get:
julia> setdiff([1,2,3], Float64[1,2,3.1], ['a', 'b', 'c'])
1-element Vector{Any}:
3
This was changed in #41769. Fwiw, I think changing the eltype of the result was a mistake (https://github.com/JuliaLang/julia/pull/41769#issuecomment-898436916). You also now get things like
julia> intersect(BitSet(1:4), (x for x in 1:1))
Set{Any} with 1 element:
1
In Julia 1.7 I see:
while in Julia 1.8 I see:
This broke some code in ITensors.jl which implicitly assumed the previous behavior. It's not hard to work around this and I'm not sure if there was an implied guarantee that this wouldn't change from version to version, I'm curious to hear if this was intended/what led to this change.
The behavior of 1.7 makes more sense to me since
setdiff
outputs the elements unique to the first input, so it seems like it should have the same element type as the first input.