summaryrefslogtreecommitdiffstats
path: root/contrib/python/cachetools
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-07-30 09:43:44 +0300
committerrobot-piglet <[email protected]>2024-07-30 09:54:58 +0300
commit704143d4c8c957833b5188e17e3ad4bfe89c64fc (patch)
tree4936024e8757cd7418ce6ea6283678d5a1416e89 /contrib/python/cachetools
parenteb0bb874facabf638050028b828cdba2b7c532bf (diff)
Intermediate changes
Diffstat (limited to 'contrib/python/cachetools')
-rw-r--r--contrib/python/cachetools/py3/.dist-info/METADATA2
-rw-r--r--contrib/python/cachetools/py3/cachetools/__init__.py6
-rw-r--r--contrib/python/cachetools/py3/cachetools/func.py4
-rw-r--r--contrib/python/cachetools/py3/cachetools/keys.py7
-rw-r--r--contrib/python/cachetools/py3/ya.make2
5 files changed, 17 insertions, 4 deletions
diff --git a/contrib/python/cachetools/py3/.dist-info/METADATA b/contrib/python/cachetools/py3/.dist-info/METADATA
index 5846ebf1676..6b6a2015511 100644
--- a/contrib/python/cachetools/py3/.dist-info/METADATA
+++ b/contrib/python/cachetools/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cachetools
-Version: 5.3.3
+Version: 5.4.0
Summary: Extensible memoizing collections and decorators
Home-page: https://github.com/tkem/cachetools/
Author: Thomas Kemmer
diff --git a/contrib/python/cachetools/py3/cachetools/__init__.py b/contrib/python/cachetools/py3/cachetools/__init__.py
index 341c1c7ff09..5a9a042cbdc 100644
--- a/contrib/python/cachetools/py3/cachetools/__init__.py
+++ b/contrib/python/cachetools/py3/cachetools/__init__.py
@@ -13,7 +13,7 @@ __all__ = (
"cachedmethod",
)
-__version__ = "5.3.3"
+__version__ = "5.4.0"
import collections
import collections.abc
@@ -241,6 +241,10 @@ class MRUCache(Cache):
"""Most Recently Used (MRU) cache implementation."""
def __init__(self, maxsize, getsizeof=None):
+ from warnings import warn
+
+ warn("MRUCache is deprecated", DeprecationWarning, stacklevel=2)
+
Cache.__init__(self, maxsize, getsizeof)
self.__order = collections.OrderedDict()
diff --git a/contrib/python/cachetools/py3/cachetools/func.py b/contrib/python/cachetools/py3/cachetools/func.py
index 0c09a60b495..3eafddf1135 100644
--- a/contrib/python/cachetools/py3/cachetools/func.py
+++ b/contrib/python/cachetools/py3/cachetools/func.py
@@ -82,6 +82,10 @@ def mru_cache(maxsize=128, typed=False):
up to `maxsize` results based on a Most Recently Used (MRU)
algorithm.
"""
+ from warnings import warn
+
+ warn("@mru_cache is deprecated", DeprecationWarning, stacklevel=2)
+
if maxsize is None:
return _cache({}, None, typed)
elif callable(maxsize):
diff --git a/contrib/python/cachetools/py3/cachetools/keys.py b/contrib/python/cachetools/py3/cachetools/keys.py
index f2feb4182b7..8689b17b9da 100644
--- a/contrib/python/cachetools/py3/cachetools/keys.py
+++ b/contrib/python/cachetools/py3/cachetools/keys.py
@@ -1,6 +1,6 @@
"""Key functions for memoizing decorators."""
-__all__ = ("hashkey", "methodkey", "typedkey")
+__all__ = ("hashkey", "methodkey", "typedkey", "typedmethodkey")
class _HashedTuple(tuple):
@@ -55,3 +55,8 @@ def typedkey(*args, **kwargs):
key += tuple(type(v) for v in args)
key += tuple(type(v) for _, v in sorted(kwargs.items()))
return key
+
+
+def typedmethodkey(self, *args, **kwargs):
+ """Return a typed cache key for use with cached methods."""
+ return typedkey(*args, **kwargs)
diff --git a/contrib/python/cachetools/py3/ya.make b/contrib/python/cachetools/py3/ya.make
index 71b6f19603e..ac118e7e265 100644
--- a/contrib/python/cachetools/py3/ya.make
+++ b/contrib/python/cachetools/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(5.3.3)
+VERSION(5.4.0)
LICENSE(MIT)