add default parameter to pop on LRUCache

This commit is contained in:
Victor Shyba 2021-06-04 12:15:47 -03:00
parent a9f6a68952
commit 00d038c8f3

View file

@ -313,8 +313,8 @@ class LRUCache:
def clear(self): def clear(self):
self.cache.clear() self.cache.clear()
def pop(self, key): def pop(self, key, default=None):
return self.cache.pop(key) return self.cache.pop(key, default)
def __setitem__(self, key, value): def __setitem__(self, key, value):
return self.set(key, value) return self.set(key, value)