mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-04 05:20:48 -05: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