mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Add __contains__
This commit is contained in:
parent
eaa836e8ca
commit
5b142788d2
@ -13,6 +13,9 @@ class TreeCache(object):
|
||||
def __setitem__(self, key, value):
|
||||
return self.set(key, value)
|
||||
|
||||
def __contains__(self, key):
|
||||
return self.get(key, SENTINEL) is not SENTINEL
|
||||
|
||||
def set(self, key, value):
|
||||
node = self.root
|
||||
for k in key[:-1]:
|
||||
|
Loading…
Reference in New Issue
Block a user