I didn't find a conversation around whether haskey should always return true for DefaultDict.
julia> using DataStructures: DefaultDict
julia> d1 = DefaultDict(0, :A=>1, :B=>2)
DefaultDict{Symbol,Int64,Int64} with 2 entries:
:A => 1
:B => 2
julia> haskey(d1, :C)
false
julia> d1[:C]
0
This would make it inconsistent with keys, but consistent with getindex.
I didn't find a conversation around whether
haskeyshould always returntrueforDefaultDict.This would make it inconsistent with
keys, but consistent withgetindex.