I just recently discovered that push! is implemented for Dict and it states the following in the docstring:
Because of this I sort of (maybe naively) expected push!(::OrderedDict, ::Pair) to always insert entries at the end, but this doesn't seem to be the case:
julia> using OrderedCollections
julia> d = OrderedDict(:x => 1)
OrderedDict{Symbol, Int64} with 1 entry:
:x => 1
julia> push!(d, :y => 2)
OrderedDict{Symbol, Int64} with 2 entries:
:x => 1
:y => 2
julia> push!(d, :x => 3) # Expected `:x => 3` to be after `:y => 2` here
OrderedDict{Symbol, Int64} with 2 entries:
:x => 3
:y => 2
Is this intentional?
I just recently discovered that
push!is implemented forDictand it states the following in the docstring:Because of this I sort of (maybe naively) expected
push!(::OrderedDict, ::Pair)to always insert entries at the end, but this doesn't seem to be the case:Is this intentional?