@iamed2 pointed this out in #59, [here](https://github.com/JuliaCollections/OrderedCollections.jl/pull/59#issuecomment-704010121). We do not have consistency between the `pop!` function for `LittleDict` and `OrderedDict`. ### LittleDict Will return `nothing` if the key is not found. https://github.com/JuliaCollections/OrderedCollections.jl/blob/5fb23d835c8dd4abd98ba871862426c2e96bafd2/src/little_dict.jl#L239-L251 ### OrderedDict Will throw a `KeyError` if the key is not found. https://github.com/JuliaCollections/OrderedCollections.jl/blob/5fb23d835c8dd4abd98ba871862426c2e96bafd2/src/ordered_dict.jl#L380-L383 I propose that we make the following changes: 1) Have `LittleDict` throw a `KeyError` when the key is not found. 2) Introduce a new function which provides a `default` value to return if key DNE (#59)
@iamed2 pointed this out in #59, here. We do not have consistency between the
pop!function forLittleDictandOrderedDict.LittleDict
Will return
nothingif the key is not found.OrderedCollections.jl/src/little_dict.jl
Lines 239 to 251 in 5fb23d8
OrderedDict
Will throw a
KeyErrorif the key is not found.OrderedCollections.jl/src/ordered_dict.jl
Lines 380 to 383 in 5fb23d8
I propose that we make the following changes:
LittleDictthrow aKeyErrorwhen the key is not found.defaultvalue to return if key DNE (LittleDict pop! default #59)