
    Vh                    l    d Z ddlmZ ddlmZ ddlZddlm	Z	  ej                  d      Z G d d      Zy)	z@Cache for commonly shared data that is intended to be immutable.    )annotationsN   )CommonConfigTValuec                  (    e Zd ZdZddZddZddZy)	CommonCachezCommon cache.c                    || _         y )N)args)selfr
   s     L/home/dcms/DCMS/lib/python3.12/site-packages/ansible_test/_internal/cache.py__init__zCommonCache.__init__   s	    	    c                    || j                   j                  vr |       | j                   j                  |<   | j                   j                  |   S )zsReturn the value from the cache identified by the given key, using the specified factory method if it is not found.r
   cacher   keyfactorys      r   getzCommonCache.get   s9    diioo%#*9DIIOOC yys##r   c                    || j                   j                  vr) || j                         | j                   j                  |<   | j                   j                  |   S )zReturn the value from the cache identified by the given key, using the specified factory method (which accepts args) if it is not found.r   r   s      r   get_with_argszCommonCache.get_with_args   s@    diioo%#*499#5DIIOOC yys##r   N)r
   r   returnNone)r   strr   zc.Callable[[], TValue]r   r   )r   r   r   z"c.Callable[[CommonConfig], TValue]r   r   )__name__
__module____qualname____doc__r   r   r    r   r   r   r      s    $$r   r   )r   
__future__r   collections.abcabcctypingtconfigr   TypeVarr   r   r   r   r   <module>r(      s2    F "   
8	$ $r   