I am a little confused by the following, is it intentional that == does not take into account the order of keys for OrderedDict?
julia> a1 = OrderedDict(:A => 1, :B => 2, :C => 3)
OrderedDict{Symbol, Int64} with 3 entries:
:A => 1
:B => 2
:C => 3
julia> a2 = OrderedDict(:B => 2, :A => 1, :C => 3)
OrderedDict{Symbol, Int64} with 3 entries:
:B => 2
:A => 1
:C => 3
julia> a1 == a2
true
this is mainly motivated by testing purposes, as I think in tests one wants to check that also the keys order is correct. Well, arguably one can always do
@test all(kv1 == kv2 for (kv1, kv2) in zip(a1, a2))
so maybe it's not a biggie.
I am a little confused by the following, is it intentional that
==does not take into account the order of keys forOrderedDict?this is mainly motivated by testing purposes, as I think in tests one wants to check that also the keys order is correct. Well, arguably one can always do
so maybe it's not a biggie.