Add clear method

master
Ethan Dalool 2017-05-06 18:28:41 -07:00
parent d7bf0aec29
commit 828c5ba079
1 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,10 @@ class Cache:
if age > self.maxage:
self.remove(key)
def clear(self):
self._dict.clear()
self._recency.clear()
def get(self, key, fallback=None):
try:
return self[key]