← Back
Editing: cache.cpython-311.pyc
� �Ïc� � �h � d dl mZ d dlmZ d dlmZmZmZmZm Z m Z mZmZm Z g d�Z ede �� � Z ed� � Z G d� d e eef � � Z ed ee df �� � Z ed� � Z G d � deeef � � Z ededef �� � Zddedeegef fd�ZdS )� )�deque)�wraps) �Any�Callable�Deque�Dict�Generic�Hashable�Tuple�TypeVar�cast)�SimpleCache� FastDictCache�memoized�_T)�bound�_Uc �P � e Zd ZdZddeddfd�Zdedeg ef defd �Z dd �Z dS ) r z� Very simple cache that discards the oldest item when the cache size is exceeded. :param maxsize: Maximum size of the cache. (Don't make it too big.) � �maxsize�returnNc �X � |dk sJ �i | _ t � � | _ || _ d S �Nr )�_datar �_keysr )�selfr s �6/usr/lib/python3/dist-packages/prompt_toolkit/cache.py�__init__zSimpleCache.__init__ s, � ���{�{�{�{�#%�� � %���� �#����� �key�getter_funcc �, � | j | S # t $ rz |� � }|| j |<