관리-도구
편집 파일: _collections.cpython-35.pyc
��Re(* � @ s d d l m Z y d d l m Z m Z Wn( e k rT d d l m Z m Z Yn Xy d d l m Z Wn% e k r� Gd d � d � Z Yn Xd d l m Z d d l m Z d d l m Z m Z m Z d d g Z e � Z Gd d � d e � Z Gd d � d e � Z d S)� )�absolute_import)�Mapping�MutableMapping)�RLockc @ s( e Z d Z d d � Z d d � Z d S)r c C s d S)N� )�selfr r ��/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/urllib3/_collections.py� __enter__ s zRLock.__enter__c C s d S)Nr )r �exc_type� exc_value� tracebackr r r �__exit__ s zRLock.__exit__N)�__name__� __module__�__qualname__r r r r r r r s r )�OrderedDict� )� InvalidHeader)�iterkeys� itervalues�PY3�RecentlyUsedContainer�HTTPHeaderDictc @ s� e Z d Z d Z e Z d d d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d S)r a� Provides a thread-safe dict-like container which maintains up to ``maxsize`` keys while throwing away the least-recently-used keys beyond ``maxsize``. :param maxsize: Maximum number of recent elements to retain. :param dispose_func: Every time an item is evicted from the container, ``dispose_func(value)`` is called. Callback which will get called � Nc C s1 | | _ | | _ | j � | _ t � | _ d S)N)�_maxsize�dispose_func�ContainerCls� _containerr �lock)r �maxsizer r r r �__init__. s zRecentlyUsedContainer.__init__c C s8 | j �( | j j | � } | | j | <| SWd QRXd S)N)r r �pop)r �key�itemr r r �__getitem__5 s z!RecentlyUsedContainer.__getitem__c C s� t } | j �Z | j j | t � } | | j | <t | j � | j k re | j j d d � \ } } Wd QRX| j r� | t k r� | j | � d S)N�lastF)�_Nullr r �get�lenr �popitemr )r r"