mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-09-09 15:31:55 +00: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