
     h                     @    d Z dZ G d de      ZefZd Zd Zd Zd Zy)	z'Key functions for memoizing decorators.)hashkey	methodkeytypedkeytypedmethodkeyc                   t    e Zd ZdZdZej                  fdZej                  fdZej                  fdZd Z	y)_HashedTuplezA 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                 @    | j                   }| ||       x| _         }|S N)_HashedTuple__hashvalue)selfhash	hashvalues      O/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/cachetools/keys.py__hash__z_HashedTuple.__hash__   s*    $$	+/:5Dy    c                 &    t         || |            S r	   r   r   otheradds      r   __add__z_HashedTuple.__add__   s    Ce,--r   c                 &    t         |||             S r	   r   r   s      r   __radd__z_HashedTuple.__radd__   s    Ct,--r   c                     i S r	    )r   s    r   __getstate__z_HashedTuple.__getstate__   s    	r   )
__name__
__module____qualname____doc__r
   tupler   r   r   r   r   r   r   r   r      s;     K!NN  "' . #(-- .r   r   c            	          |r3t        | t        t        |j                               t              z         S t        |       S )z8Return a cache key for the specified hashable arguments.)r   sumsorteditems_kwmark)argskwargss     r   r   r   %   s4     D3vflln'=w#GGHHD!!r   c                     t        |i |S )z/Return a cache key for use with cached methods.)r   r   r&   r'   s      r   r   r   .   s    D#F##r   c                      t        | i |}|t        d | D              z  }|t        d t        |j                               D              z  }|S )z>Return a typed cache key for the specified hashable arguments.c              3   2   K   | ]  }t        |        y wr	   type).0vs     r   	<genexpr>ztypedkey.<locals>.<genexpr>7   s     '$Qa$s   c              3   8   K   | ]  \  }}t        |        y wr	   r,   )r.   _r/   s      r   r0   ztypedkey.<locals>.<genexpr>8   s     <%;TQa%;s   )r   r    r#   r$   )r&   r'   keys      r   r   r   3   sM     4
"6
"C5'$'''C5<VFLLN%;<<<CJr   c                     t        |i |S )z5Return a typed cache key for use with cached methods.)r   r)   s      r   r   r   <   s    T$V$$r   N)	r   __all__r    r   r%   r   r   r   r   r   r   r   <module>r6      s6    -
@5 8 /"$
%r   