类定义及构造函数class LRUCache(object): NOT_FOUND = None def __init__(self): self.datas = dict() self.lru = list() self.lru_cap = 20self.datas = dict():保存key-value数据的dictself.
用Python实现了一个支持过期时间、带过期自动淘汰功能的Cache
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号