Came across the following unexpected asymmetric behaviour for push! and prepend!
B = Vector{Date}()
prepend!(B,Date(2021,2,2)) # Errors
A = Vector{Date}()
push!(A,Date(2021,2,2)) # OK
But
B = Vector{Date}()
prepend!(B,[Date(2021,2,2)]) # OK
A = Vector{Date}()
push!(A,[Date(2021,2,2)]) # Errors
Also,
A = Vector{Float64}()
push!(A,1.0) # OK
B = Vector{Float64}()
prepend!(B,1.0) # OK
A = Vector{Float64}()
push!(A,[1.0]) # Errors
B = Vector{Float64}()
prepend!(B,[1.0]) # OK
Shouldn’t the behaviour of push! and prepend! be similar in terms of throwing errors?
Also, although the behaviour of push! is consistent across types, it seems that such is not the case for prepend! (B = Vector{Float64}(); prepend!(B,1.0)
runs fine, but B = Vector{Date}(); prepend!(B,Date(2021,2,2))
errors, as shown above)