-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Change in element type of setdiff
output from Julia 1.7 to 1.8
#46657
Comments
mtfishman
changed the title
Change in output of element type of
Change in element type of Sep 6, 2022
setdiff
from Julia 1.7 to 1.8setdiff
output from Julia 1.7 to 1.8
I don't have 1.7 installed, but I'm curious what you get for this:
|
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 (#41769 (comment)). julia> intersect(BitSet(1:4), (x for x in 1:1))
Set{Any} with 1 element:
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.The text was updated successfully, but these errors were encountered: