Current File : //usr/lib64/python3.6/site-packages/borg/__pycache__/lrucache.cpython-36.pyc
3

y��b��@se�ZGdd�d�ZdS)c@s^eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zddd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�LRUCachecCsi|_g|_||_||_dS)N)�_cache�_lru�	_capacity�_dispose)�selfZcapacityZdispose�r� /usr/lib64/python3.6/lrucache.py�__init__szLRUCache.__init__cCsN||jkstd��|jj|�x t|j�|jkr>||jd=q W||j|<dS)NzQUnexpected attempt to replace a cached item, without first deleting the old item.�)r�AssertionErrorr�append�lenr)r�key�valuerrr�__setitem__szLRUCache.__setitem__cCs&|j|}|jj|�|jj|�|S)N)rr�remover)rrrrrr�__getitem__s
zLRUCache.__getitem__cCs&|jj|�}|j|�|jj|�dS)N)r�poprrr)rrrrrr�__delitem__s
zLRUCache.__delitem__cCs
||jkS)N)r)rrrrr�__contains__szLRUCache.__contains__NcCs6|jj|t�}|tkr|S|jj|�|jj|�|S)N)r�get�sentinelrrr)rr�defaultrrrrr"szLRUCache.getcCs ||jkstd��||j|<dS)Nz1Unexpected attempt to update a non-existing item.)rr)rrrrrr�upd*szLRUCache.updcCs,x|jj�D]}|j|�qW|jj�dS)N)r�valuesr�clear)rrrrrr0szLRUCache.clearcCs
|jj�S)N)r�items)rrrrr5szLRUCache.itemscCs
t|j�S)N)r
r)rrrr�__len__8szLRUCache.__len__)N)
�__name__�
__module__�__qualname__r	rrrrrrrrrrrrrrs	
rN)�objectrrrrrr�<module>s