-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
array of array promotion #24988
Comments
IMHO explicit is better than implicit also in this case. julia> repr(Any[ [1, 2, 3], [1, 0.5, 0.25, 0.125], [-1, -2] ])
"Any[[1, 2, 3], [1.0, 0.5, 0.25, 0.125], [-1, -2]]"
julia> repr([ [1, 2, 3], [1, 0.5, 0.25, 0.125], [-1, -2] ])
"Array{Float64,1}[[1.0, 2.0, 3.0], [1.0, 0.5, 0.25, 0.125], [-1.0, -2.0]]" I like to see: julia> repr([ [1, 2, 3], [1, 0.5, 0.25, 0.125], [-1, -2] ])
"[[1, 2, 3], [1.0, 0.5, 0.25, 0.125], [-1, -2]]"
julia> repr(Array{Float64,1}[ [1, 2, 3], [1, 0.5, 0.25, 0.125], [-1, -2] ])
"Array{Float64,1}[[1.0, 2.0, 3.0], [1.0, 0.5, 0.25, 0.125], [-1.0, -2.0]]" |
Wasn't this already changed by #22757?
|
Looms like it. That’s what I was expecting to need to implement. @StefanKarpinski what’s up with you example not matching Jeff’s result? |
My mistake! I must have run the example in a 0.6 session – I've been running 0.6 for Pkg3 for a while. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Intersting promotion example here: https://discourse.julialang.org/t/what-on-earth-does-any-do/7625/5. In short, this is good:
But this is less good:
Perhaps array promotion should not try to convert all arrays to the same element type unless that element type is concrete.
The text was updated successfully, but these errors were encountered: