o n¾nhã@sLdZddlmZddlmZddlZddlm Z e  d¡Z Gdd„dƒZ dS) z@Cache for commonly shared data that is intended to be immutable.é)Ú annotationsNé)Ú CommonConfigÚTValuec@s.eZdZdZddd„Zdd d„Zddd„ZdS)Ú CommonCachez Common cache.ÚargsrÚreturnÚNonecCs ||_dS)N)r)Úselfr©r úG/usr/local/lib/python3.10/dist-packages/ansible_test/_internal/cache.pyÚ__init__s zCommonCache.__init__ÚkeyÚstrÚfactoryúc.Callable[[], TValue]rcCs&||jjvr |ƒ|jj|<|jj|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 rrr r r Úgets  zCommonCache.getú"c.Callable[[CommonConfig], TValue]cCs*||jjvr||jƒ|jj|<|jj|S)zˆReturn the value from the cache identified by the given key, using the specified factory method (which accepts args) if it is not found.rrr r r Ú get_with_argss  zCommonCache.get_with_argsN)rrrr )rrrrrr)rrrrrr)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrr r r r rs   r) rÚ __future__rÚcollections.abcÚabcÚcÚtypingÚtÚconfigrÚTypeVarrrr r r r Ús