def popitem(self): key, val = LRUCache.popitem(self) # Try to close file if we can try: val.close() except AttributeError: # catch close() not being defined pass return key, val
def popitem(self): key, val = LRUCache.popitem(self) if self._evict: self._evict(key, val) return key, val
def popitem(self): key, val = LRUCache.popitem(self) val.Reset() return key, val
def popitem(self): key, value = LRUCache.popitem(self) with open(os.path.join(self.folder, str(key)), 'wb') as f: pickle.dump(value, f)
def popitem(self): key, val = LRUCache.popitem(self) evict = self.__evict if evict: evict(key, val) return key, val