Open j123b567 opened 4 years ago
Let me know which commit this change was made in so I can review, thanks.
89897b4e07a80b731ca5b4e2b2df5ca54e825871 This commit says that it is because of consistency, but it is against it.
None of lgetall
, lget
, lpop
, dget
, dpop
return False
in case of missing key. They will instead raise KeyError
.
Other methods never return data so they are irrelevant for comparison.
In latest versions, there was made bad decision to replace
None
withFalse
. It is now not possible to distinguis betweenFalse
and not set entry because neitherKeyError
norNone
is returned like in all other standard python interfaces (eg.dict
)Only good way to solve this would be to mimic python
dict
and introduce full featuredget()
method with user configurable default argument, which is used when there is no entry in the db with defaultdefault
set to None.Please, can you revert it back and use
None
in every case, where there is no single item to return or at least introduce optionaldefault
argument, so it is possible for the user to overcome this bad decision without maintaining its own downstream version.