-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
breakingThis change will break codeThis change will break codebroadcastApplying a function over a collectionApplying a function over a collectionneeds decisionA decision on this change is neededA decision on this change is needed
Description
Brought up by the ever vigilant @bkamins, we currently support broadcast in some seemingly surprising cases:
julia> rand(5, 0, 5) .+ (1:5)
5×0×5 Array{Float64,3}
julia> rand(5, 0, 5) .+ 1
5×0×5 Array{Float64,3}
julia> rand(5, 0, 5) .+ (1:5)
5×0×5 Array{Float64,3}
julia> rand(5, 0, 5) .+ ones(5,1,1)
5×0×5 Array{Float64,3}
Perhaps even more surprising is this:
julia> x = []
0-element Array{Any,1}
julia> x .= 1
0-element Array{Any,1}
julia> [] .= [1]
0-element Array{Any,1}
I don't think this is horrible enough to warrant a breaking change before 2.0, but perhaps may be something to consider changing in the future.
ParadaCarleton
Metadata
Metadata
Assignees
Labels
breakingThis change will break codeThis change will break codebroadcastApplying a function over a collectionApplying a function over a collectionneeds decisionA decision on this change is neededA decision on this change is needed