patx / pickledb

pickleDB is an open source key-value store using Python's json module.
https://patx.github.io/pickledb
BSD 3-Clause "New" or "Revised" License
925 stars 125 forks source link

Add a get method with default value #3

Closed c0indev3l closed 6 years ago

c0indev3l commented 11 years ago

It will be nice to provide a get method which return a default value when nothing was stored for a given key into database like a defaultdict http://docs.python.org/2/library/collections.html#collections.defaultdict

db.get('key', 'default_value')
sureshdsk commented 8 years ago

Added this feature and created a PR https://github.com/patx/pickledb/pull/23