Skip to content

Commit

Permalink
get() method now returns False instead of None, since the rest of the…
Browse files Browse the repository at this point in the history
… library returns True and False values
  • Loading branch information
patx44 committed Sep 7, 2018
1 parent d098b4a commit 89897b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pickledb.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get(self, key):
try:
return self.db[key]
except KeyError:
return None
return False

def getall(self):
'''Return a list of all keys in db'''
Expand Down

1 comment on commit 89897b4

@MaffooClock
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would have preferred None since it's more clear that the requested key has no value, whereas False could be a valid value for a given key.

Better yet, PR #23 would have solved this beautifully.

Please sign in to comment.