cachetools 7.0.4__tar.gz → 7.0.6__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.
Files changed (33) hide show
  1. {cachetools-7.0.4 → cachetools-7.0.6}/CHANGELOG.rst +16 -0
  2. {cachetools-7.0.4/src/cachetools.egg-info → cachetools-7.0.6}/PKG-INFO +6 -1
  3. {cachetools-7.0.4 → cachetools-7.0.6}/pyproject.toml +5 -0
  4. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools/__init__.py +2 -2
  5. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools/_cachedmethod.py +10 -6
  6. {cachetools-7.0.4 → cachetools-7.0.6/src/cachetools.egg-info}/PKG-INFO +6 -1
  7. {cachetools-7.0.4 → cachetools-7.0.6}/LICENSE +0 -0
  8. {cachetools-7.0.4 → cachetools-7.0.6}/MANIFEST.in +0 -0
  9. {cachetools-7.0.4 → cachetools-7.0.6}/README.rst +0 -0
  10. {cachetools-7.0.4 → cachetools-7.0.6}/docs/conf.py +0 -0
  11. {cachetools-7.0.4 → cachetools-7.0.6}/docs/index.rst +0 -0
  12. {cachetools-7.0.4 → cachetools-7.0.6}/setup.cfg +0 -0
  13. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools/_cached.py +0 -0
  14. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools/func.py +0 -0
  15. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools/keys.py +0 -0
  16. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools.egg-info/SOURCES.txt +0 -0
  17. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools.egg-info/dependency_links.txt +0 -0
  18. {cachetools-7.0.4 → cachetools-7.0.6}/src/cachetools.egg-info/top_level.txt +0 -0
  19. {cachetools-7.0.4 → cachetools-7.0.6}/tests/__init__.py +0 -0
  20. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_cache.py +0 -0
  21. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_cached.py +0 -0
  22. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_cachedmethod.py +0 -0
  23. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_classmethod.py +0 -0
  24. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_fifo.py +0 -0
  25. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_func.py +0 -0
  26. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_keys.py +0 -0
  27. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_lfu.py +0 -0
  28. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_lru.py +0 -0
  29. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_rr.py +0 -0
  30. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_threading.py +0 -0
  31. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_tlru.py +0 -0
  32. {cachetools-7.0.4 → cachetools-7.0.6}/tests/test_ttl.py +0 -0
  33. {cachetools-7.0.4 → cachetools-7.0.6}/tox.ini +0 -0
@@ -1,3 +1,19 @@
1
+ v7.0.6 (2026-04-20)
2
+ ===================
3
+
4
+ - Minor code improvements.
5
+
6
+ - Update project URLs.
7
+
8
+ - Update CI environment.
9
+
10
+
11
+ v7.0.5 (2026-03-09)
12
+ ===================
13
+
14
+ - Minor ``@cachedmethod`` performance improvements.
15
+
16
+
1
17
  v7.0.4 (2026-03-08)
2
18
  ===================
3
19
 
@@ -1,11 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cachetools
3
- Version: 7.0.4
3
+ Version: 7.0.6
4
4
  Summary: Extensible memoizing collections and decorators
5
5
  Author-email: Thomas Kemmer <tkemmer@computer.org>
6
6
  Maintainer-email: Thomas Kemmer <tkemmer@computer.org>
7
7
  License-Expression: MIT
8
8
  Project-URL: Homepage, https://github.com/tkem/cachetools/
9
+ Project-URL: Documentation, https://cachetools.readthedocs.io/en/stable/
10
+ Project-URL: Source, https://github.com/tkem/cachetools/
11
+ Project-URL: Repository, https://github.com/tkem/cachetools/
12
+ Project-URL: Issues, https://github.com/tkem/cachetools/issues
13
+ Project-URL: Changelog, https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst
9
14
  Classifier: Development Status :: 5 - Production/Stable
10
15
  Classifier: Intended Audience :: Developers
11
16
  Classifier: Operating System :: OS Independent
@@ -32,6 +32,11 @@ classifiers = [
32
32
 
33
33
  [project.urls]
34
34
  Homepage = "https://github.com/tkem/cachetools/"
35
+ Documentation = "https://cachetools.readthedocs.io/en/stable/"
36
+ Source = "https://github.com/tkem/cachetools/"
37
+ Repository = "https://github.com/tkem/cachetools/"
38
+ Issues = "https://github.com/tkem/cachetools/issues"
39
+ Changelog = "https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst"
35
40
 
36
41
  [tool.setuptools]
37
42
  package-dir = {"" = "src"}
@@ -12,7 +12,7 @@ __all__ = (
12
12
  "cachedmethod",
13
13
  )
14
14
 
15
- __version__ = "7.0.4"
15
+ __version__ = "7.0.6"
16
16
 
17
17
  import collections
18
18
  import collections.abc
@@ -397,7 +397,7 @@ class _TimedCache(Cache):
397
397
  def __getattr__(self, name):
398
398
  return getattr(self.__timer, name)
399
399
 
400
- def __init__(self, maxsize, timer=time.monotonic, getsizeof=None):
400
+ def __init__(self, maxsize, timer, getsizeof=None):
401
401
  Cache.__init__(self, maxsize, getsizeof)
402
402
  self.__timer = _TimedCache._Timer(timer)
403
403
 
@@ -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 functools.partial(self.__key, self._obj)
55
+ return self.__key # self._obj passed via functools.partial
52
56
 
53
57
  @property
54
58
  def cache_lock(self):
55
- return None if self.__lock is None else self.__lock(self._obj)
59
+ return self.__lock(self._obj)
56
60
 
57
61
  @property
58
62
  def cache_condition(self):
59
- return None if self.__cond is None else self.__cond(self._obj)
63
+ return self.__cond(self._obj)
60
64
 
61
65
 
62
66
  class _DescriptorBase:
@@ -1,11 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cachetools
3
- Version: 7.0.4
3
+ Version: 7.0.6
4
4
  Summary: Extensible memoizing collections and decorators
5
5
  Author-email: Thomas Kemmer <tkemmer@computer.org>
6
6
  Maintainer-email: Thomas Kemmer <tkemmer@computer.org>
7
7
  License-Expression: MIT
8
8
  Project-URL: Homepage, https://github.com/tkem/cachetools/
9
+ Project-URL: Documentation, https://cachetools.readthedocs.io/en/stable/
10
+ Project-URL: Source, https://github.com/tkem/cachetools/
11
+ Project-URL: Repository, https://github.com/tkem/cachetools/
12
+ Project-URL: Issues, https://github.com/tkem/cachetools/issues
13
+ Project-URL: Changelog, https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst
9
14
  Classifier: Development Status :: 5 - Production/Stable
10
15
  Classifier: Intended Audience :: Developers
11
16
  Classifier: Operating System :: OS Independent
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