Skip to content
Snippets Groups Projects
Commit 5b142788 authored by David Baker's avatar David Baker
Browse files

Add __contains__

parent eaa836e8
No related branches found
No related tags found
No related merge requests found
......@@ -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]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment