o 7]h@sNddlmZddlmZmZmZedZedZGdddeeefeZdS)) OrderedDict)DictGenericTypeVarCacheKey CacheValuecs^eZdZdZdeddffdd Zdededdfd d Zd e eefdedefd d Z Z S)LRUCachez A dictionary-like container that stores a given maximum items. If an additional item is added when the LRUCache is full, the least recently used key is discarded to make room for the new item. cache_sizereturnNcs||_tt|dS)N)r superr__init__)selfr  __class__=/usr/lib/python3/dist-packages/pip/_vendor/rich/_lru_cache.pyr szLRUCache.__init__keyvaluecCs4||vrt||jkr|jddt|||dS)z7Store a new views, potentially discarding an old value.F)lastN)lenr popitemr __setitem__r rrrrrrs zLRUCache.__setitem__r cCs*t||}t||t||||S)z-Gets the item, but also makes it most recent.)r __getitem__ __delitem__rrrrrrs  zLRUCache.__getitem__) __name__ __module__ __qualname____doc__intr rrrrr __classcell__rrrrr s &rN) collectionsrtypingrrrrrrrrrrs