|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/cachetools/__pycache__/ |
U
O��g� � @ sB d Z dZG dd� de�ZefZdd� Zdd� Zdd � Zd
d� ZdS )
z'Key functions for memoizing decorators.)�hashkey� methodkey�typedkey�typedmethodkeyc @ sF e Zd ZdZdZejfdd�Zejfdd�Zejfdd�Zd d
� Z dS )�_HashedTuplez�A tuple that ensures that hash() will be called no more than once
per element, since cache decorators will hash the key multiple
times on a cache miss. See also _HashedSeq in the standard
library functools implementation.
Nc C s | j }|d kr|| � | _ }|S �N)�_HashedTuple__hashvalue)�self�hash� hashvalue� r �</opt/cppython/lib/python3.8/site-packages/cachetools/keys.py�__hash__ s z_HashedTuple.__hash__c C s t || |��S r �r �r �other�addr r r �__add__ s z_HashedTuple.__add__c C s t ||| ��S r r r r r r �__radd__ s z_HashedTuple.__radd__c C s i S r r )r r r r �__getstate__ s z_HashedTuple.__getstate__)
�__name__�
__module__�__qualname__�__doc__r �tupler
r r r r r r r r s r c O s* |rt | tt|�� �t� �S t | �S dS )z8Return a cache key for the specified hashable arguments.N)r �sum�sorted�items�_kwmark)�args�kwargsr r r r % s r c O s
t ||�S )z/Return a cache key for use with cached methods.)r �r r r r r r r . s r c O sB t | |�}|tdd� | D ��7 }|tdd� t|�� �D ��7 }|S )z>Return a typed cache key for the specified hashable arguments.c s s | ]}t |�V qd S r ��type)�.0�vr r r � <genexpr>7 s ztypedkey.<locals>.<genexpr>c s s | ]\}}t |�V qd S r r! )r# �_r$ r r r r% 8 s )r r r r )r r �keyr r r r 3 s
r c O s
t ||�S )z5Return a typed cache key for use with cached methods.)r r r r r r <