Can supply a default return value to get()#95
Conversation
|
Why only add the functionality to get(), what about search()? |
|
Also, why not just catch KeyError and set the default value? |
I'm on the fence but with
You could definitely do that, but I think that this is a common enough case and catching an exception an "ugly" enough solution that it's worthwhile. |
|
Thanks for the contribution! |
|
Note that this was merged into 2.0, so you will need to pull a 2.x release to get this feature. (We are cutting the first 2.x release today) |
This does not introduce any breaking changes.
Closes #52