diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-09-03 08:38:14 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-09-03 08:48:33 +0300 |
commit | 40e21d90e24de76791e5fea962ebdc26b1515cf0 (patch) | |
tree | 8254e07958c84e29fb723d6e8bbf6ee398454c18 /contrib | |
parent | 3a21f8c7e965956f495377b817eb9eaaa9de88ad (diff) | |
download | ydb-40e21d90e24de76791e5fea962ebdc26b1515cf0.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/python/Automat/py3/.dist-info/METADATA | 3 | ||||
-rw-r--r-- | contrib/python/Automat/py3/ya.make | 2 | ||||
-rw-r--r-- | contrib/python/cachetools/py3/.dist-info/METADATA | 2 | ||||
-rw-r--r-- | contrib/python/cachetools/py3/cachetools/__init__.py | 23 | ||||
-rw-r--r-- | contrib/python/cachetools/py3/ya.make | 2 |
5 files changed, 22 insertions, 10 deletions
diff --git a/contrib/python/Automat/py3/.dist-info/METADATA b/contrib/python/Automat/py3/.dist-info/METADATA index 0f70edae69..b86e9ab8e6 100644 --- a/contrib/python/Automat/py3/.dist-info/METADATA +++ b/contrib/python/Automat/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Automat -Version: 24.8.0 +Version: 24.8.1 Summary: Self-service finite-state machines for the programmer on the go. Author-email: Glyph <code@glyph.im> License: Copyright (c) 2014 @@ -38,6 +38,7 @@ Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 +Requires-Python: >=3.8 Description-Content-Type: text/markdown License-File: LICENSE Requires-Dist: typing-extensions; python_version < "3.10" diff --git a/contrib/python/Automat/py3/ya.make b/contrib/python/Automat/py3/ya.make index 87be635c27..89ecf81193 100644 --- a/contrib/python/Automat/py3/ya.make +++ b/contrib/python/Automat/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(24.8.0) +VERSION(24.8.1) LICENSE(MIT) diff --git a/contrib/python/cachetools/py3/.dist-info/METADATA b/contrib/python/cachetools/py3/.dist-info/METADATA index 6b6a201551..b3ff29d899 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.4.0 +Version: 5.5.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 5a9a042cbd..2d2e2cf4ae 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.4.0" +__version__ = "5.5.0" import collections import collections.abc @@ -26,7 +26,6 @@ from . import keys class _DefaultSize: - __slots__ = () def __getitem__(self, _): @@ -378,7 +377,6 @@ class TTLCache(_TimedCache): """LRU Cache implementation with per-item time-to-live (TTL) value.""" class _Link: - __slots__ = ("key", "expires", "next", "prev") def __init__(self, key=None, expires=None): @@ -469,19 +467,26 @@ class TTLCache(_TimedCache): return self.__ttl def expire(self, time=None): - """Remove expired items from the cache.""" + """Remove expired items from the cache and return an iterable of the + expired `(key, value)` pairs. + + """ if time is None: time = self.timer() root = self.__root curr = root.next links = self.__links + expired = [] cache_delitem = Cache.__delitem__ + cache_getitem = Cache.__getitem__ while curr is not root and not (time < curr.expires): + expired.append((curr.key, cache_getitem(self, curr.key))) cache_delitem(self, curr.key) del links[curr.key] next = curr.next curr.unlink() curr = next + return expired def popitem(self): """Remove and return the `(key, value)` pair least recently used that @@ -508,7 +513,6 @@ class TLRUCache(_TimedCache): @functools.total_ordering class _Item: - __slots__ = ("key", "expires", "removed") def __init__(self, key=None, expires=None): @@ -583,7 +587,10 @@ class TLRUCache(_TimedCache): return self.__ttu def expire(self, time=None): - """Remove expired items from the cache.""" + """Remove expired items from the cache and return an iterable of the + expired `(key, value)` pairs. + + """ if time is None: time = self.timer() items = self.__items @@ -592,12 +599,16 @@ class TLRUCache(_TimedCache): if len(order) > len(items) * 2: self.__order = order = [item for item in order if not item.removed] heapq.heapify(order) + expired = [] cache_delitem = Cache.__delitem__ + cache_getitem = Cache.__getitem__ while order and (order[0].removed or not (time < order[0].expires)): item = heapq.heappop(order) if not item.removed: + expired.append((item.key, cache_getitem(self, item.key))) cache_delitem(self, item.key) del items[item.key] + return expired def popitem(self): """Remove and return the `(key, value)` pair least recently used that diff --git a/contrib/python/cachetools/py3/ya.make b/contrib/python/cachetools/py3/ya.make index ac118e7e26..16c48a0f31 100644 --- a/contrib/python/cachetools/py3/ya.make +++ b/contrib/python/cachetools/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(5.4.0) +VERSION(5.5.0) LICENSE(MIT) |