
                         @    S r SSKJr  Sr " S S\5      r\4rS rS rg)	z'Key functions for memoizing decorators.    )absolute_import)hashkeytypedkeyc                       \ rS rSrSrSr\R                  4S jr\R                  4S jr\R                  4S jr	S r
Srg)	_HashedTuple   zA 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                 B    U R                   nUc  U" U 5      =U l         nU$ N)_HashedTuple__hashvalue)selfhash	hashvalues      "lib/third_party/cachetools/keys.py__hash___HashedTuple.__hash__   s*      I%)$Z/d    c                 $    [        U" X5      5      $ r
   r   r   otheradds      r   __add___HashedTuple.__add__   s    D())r   c                 $    [        U" X5      5      $ r
   r   r   s      r   __radd___HashedTuple.__radd__   s    E())r   c                     0 $ r
    )r   s    r   __getstate___HashedTuple.__getstate__   s    Ir   )__hashvalue)__name__
__module____qualname____firstlineno____doc__r   tupler   r   r   r   __static_attributes__r   r   r   r   r      s;     +..   %}} * !& *r   r   c            	          U(       a3  [        U [        [        UR                  5       5      [        5      -   5      $ [        U 5      $ )z8Return a cache key for the specified hashable arguments.)r   sumsorteditems_kwmark)argskwargss     r   r   r   (   s4     s6&,,.#97CCDDr   c                      [        U 0 UD6nU[        S U  5       5      -  nU[        S [        UR                  5       5       5       5      -  nU$ )z>Return a typed cache key for the specified hashable arguments.c              3   8   #    U  H  n[        U5      v   M     g 7fr
   type).0vs     r   	<genexpr>typedkey.<locals>.<genexpr>5   s     %1tAwws   c              3   <   #    U  H  u  p[        U5      v   M     g 7fr
   r2   )r4   _r5   s      r   r6   r7   6   s     :#941tAww#9s   )r   r'   r+   r,   )r.   r/   keys      r   r   r   1   sM     	  #%%	%%#:6&,,.#9:	::#	*r   N)	r&   
__future__r   __all__r'   r   r-   r   r   r   r   r   <module>r=      s/    - &
!5 : /r   