Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/dogpile/cache/backends/__pycache__/memory.cpython-39.pyc
Ðазад
a t�h� � @ sN d Z ddlmZ ddlmZ ddlmZ G dd� de�ZG dd� dee�Zd S ) a Memory Backends --------------- Provides simple dictionary-based backends. The two backends are :class:`.MemoryBackend` and :class:`.MemoryPickleBackend`; the latter applies a serialization step to cached values while the former places the value as given into the dictionary. � )�CacheBackend)�DefaultSerialization)�NO_VALUEc @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dS )� MemoryBackenda� A backend that uses a plain dictionary. There is no size management, and values which are placed into the dictionary will remain until explicitly removed. Note that Dogpile's expiration of items is based on timestamps and does not remove them from the cache. E.g.:: from dogpile.cache import make_region region = make_region().configure( 'dogpile.cache.memory' ) To use a Python dictionary of your choosing, it can be passed in with the ``cache_dict`` argument:: my_dictionary = {} region = make_region().configure( 'dogpile.cache.memory', arguments={ "cache_dict":my_dictionary } ) c C s |� di �| _d S )NZ cache_dict)�pop�_cache)�self� arguments� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/dogpile/cache/backends/memory.py�__init__4 s zMemoryBackend.__init__c C s | j �|t�S �N�r �getr �r �keyr r r r 7 s zMemoryBackend.getc s � fdd�|D �S )Nc s g | ]}� j �|t��qS r r )�.0r �r r r � <listcomp>; � z+MemoryBackend.get_multi.<locals>.<listcomp>r )r �keysr r r � get_multi: s zMemoryBackend.get_multic C s || j |<