cachetools 7.0.4__tar.gz → 7.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cachetools-7.0.4 → cachetools-7.0.5}/CHANGELOG.rst +6 -0
- {cachetools-7.0.4/src/cachetools.egg-info → cachetools-7.0.5}/PKG-INFO +1 -1
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools/__init__.py +1 -1
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools/_cachedmethod.py +10 -6
- {cachetools-7.0.4 → cachetools-7.0.5/src/cachetools.egg-info}/PKG-INFO +1 -1
- {cachetools-7.0.4 → cachetools-7.0.5}/LICENSE +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/MANIFEST.in +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/README.rst +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/docs/conf.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/docs/index.rst +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/pyproject.toml +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/setup.cfg +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools/_cached.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools/func.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools/keys.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools.egg-info/SOURCES.txt +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools.egg-info/dependency_links.txt +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/src/cachetools.egg-info/top_level.txt +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/__init__.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_cache.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_cached.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_cachedmethod.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_classmethod.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_fifo.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_func.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_keys.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_lfu.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_lru.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_rr.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_threading.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_tlru.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tests/test_ttl.py +0 -0
- {cachetools-7.0.4 → cachetools-7.0.5}/tox.ini +0 -0
|
@@ -23,6 +23,10 @@ def _warn_instance_dict(msg, stacklevel):
|
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
def _none(_):
|
|
27
|
+
return None
|
|
28
|
+
|
|
29
|
+
|
|
26
30
|
class _WrapperBase:
|
|
27
31
|
"""Wrapper base class providing default implementations for properties."""
|
|
28
32
|
|
|
@@ -32,9 +36,9 @@ class _WrapperBase:
|
|
|
32
36
|
functools.update_wrapper(self, method)
|
|
33
37
|
self._obj = obj # protected
|
|
34
38
|
self.__cache = cache
|
|
35
|
-
self.__key = key
|
|
36
|
-
self.__lock = lock
|
|
37
|
-
self.__cond = cond
|
|
39
|
+
self.__key = functools.partial(key, obj)
|
|
40
|
+
self.__lock = lock if lock is not None else _none
|
|
41
|
+
self.__cond = cond if cond is not None else _none
|
|
38
42
|
|
|
39
43
|
def __call__(self, *args, **kwargs):
|
|
40
44
|
raise NotImplementedError() # pragma: no cover
|
|
@@ -48,15 +52,15 @@ class _WrapperBase:
|
|
|
48
52
|
|
|
49
53
|
@property
|
|
50
54
|
def cache_key(self):
|
|
51
|
-
return
|
|
55
|
+
return self.__key # self._obj passed via functools.partial
|
|
52
56
|
|
|
53
57
|
@property
|
|
54
58
|
def cache_lock(self):
|
|
55
|
-
return
|
|
59
|
+
return self.__lock(self._obj)
|
|
56
60
|
|
|
57
61
|
@property
|
|
58
62
|
def cache_condition(self):
|
|
59
|
-
return
|
|
63
|
+
return self.__cond(self._obj)
|
|
60
64
|
|
|
61
65
|
|
|
62
66
|
class _DescriptorBase:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|