2828
2929
3030class _MutMapMix :
31- """Convenient MutableMapping Mixin, forward to _cache."""
31+ """Convenient MutableMapping Mixin, forward to ` _cache` ."""
3232
3333 # FIXME coverage reports this as missing with Python 3.14
3434 _cache : MutableMapping # pragma: no cover
@@ -53,7 +53,7 @@ def __iter__(self):
5353
5454
5555class _KeyMutMapMix (_MutMapMix ):
56- """Convenient MutableMapping Mixin with a key filter, forward to _cache."""
56+ """Convenient MutableMapping Mixin with a key filter, forward to ` _cache` ."""
5757
5858 @abc .abstractmethod
5959 def _key (self , key : Any ) -> Any : # pragma: no cover
@@ -73,7 +73,7 @@ def __delitem__(self, key: Any):
7373
7474
7575class _StatsMix :
76- """Convenient Mixin to forward stats methods to _cache."""
76+ """Convenient Mixin to forward stats methods to ` _cache` ."""
7777
7878 def hits (self ) -> float | None :
7979 return self ._cache .hits () # type: ignore
@@ -114,9 +114,11 @@ def dbsize(self, *args, **kwargs):
114114class DebugCache (_StatsMix , MutableMapping ):
115115 """Debug class.
116116
117- :param cache: actual cache
118- :param log: logging instance
119- :param name: name of instance for output
117+ Parameters:
118+
119+ - cache: actual cache
120+ - log: logging instance
121+ - name: name of instance for output
120122 """
121123
122124 def __init__ (self , cache : MutableMapping , log : logging .Logger , name = "cache" ):
@@ -162,7 +164,7 @@ def reset(self): # pragma: no cover
162164
163165
164166class DictCache (_MutMapMix , MutableMapping ):
165- """Cache class based on dict."""
167+ """Cache class based on ` dict` ."""
166168
167169 def __init__ (self ):
168170 self ._cache = dict ()
@@ -174,17 +176,19 @@ def clear(self):
174176class LockedCache (_MutMapMix , _StatsMix , _RedisMix , MutableMapping ):
175177 """Cache class with a lock.
176178
177- :param cache: actual cache.
178- :param lock: lock (context manager) to use
179+ Parameters:
179180
180- The locked layer should be the last one before the actual cache.
181+ - cache: actual cache.
182+ - lock: lock (context manager) to use
181183
182- .. code-block: python
184+ The locked layer should be the last one before the actual cache.
183185
184- import threading
185- import cachetools as ct
186- import CacheToolsUtils as ctu
187- cache = ctu.LockedCache(ct.LFUCache(), threading.RLock())
186+ ```python
187+ import threading
188+ import cachetools as ct
189+ import CacheToolsUtils as ctu
190+ cache = ctu.LockedCache(ct.LFUCache(), threading.RLock())
191+ ```
188192 """
189193
190194 def __init__ (self , cache : MutableMapping , lock ):
0 commit comments