-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LittleDict / OrderedDict pop! consistency #61
Comments
In support: julia> pop!(Dict(), "baz")
ERROR: KeyError: key "baz" not found
Stacktrace:
[1] pop!(::Dict{Any,Any}, ::String) at ./dict.jl:570
[2] top-level scope at REPL[3]:1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@iamed2 pointed this out in #59, here. We do not have consistency between the
pop!
function forLittleDict
andOrderedDict
.LittleDict
Will return
nothing
if the key is not found.OrderedCollections.jl/src/little_dict.jl
Lines 239 to 251 in 5fb23d8
OrderedDict
Will throw a
KeyError
if 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:
LittleDict
throw aKeyError
when the key is not found.default
value to return if key DNE (LittleDict pop! default #59)The text was updated successfully, but these errors were encountered: