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

Useless "try-except" in "PickeDB.get" #91

Open Otomatyk opened 1 year ago

Otomatyk commented 1 year ago

Hello. In PickeDB.get we see :

try:
    return self.db[key]
except KeyError:
    return False

However, I think it must uses dict.get that returns the default arg if the key doesn't exist. The code will loke like this : return self.db.get(key, False)