Skip to content

Commit 40e21d9

Browse files
committed
Intermediate changes
1 parent 3a21f8c commit 40e21d9

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

contrib/python/Automat/py3/.dist-info/METADATA

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: Automat
3-
Version: 24.8.0
3+
Version: 24.8.1
44
Summary: Self-service finite-state machines for the programmer on the go.
55
Author-email: Glyph <code@glyph.im>
66
License: Copyright (c) 2014
@@ -38,6 +38,7 @@ Classifier: Programming Language :: Python :: 3.9
3838
Classifier: Programming Language :: Python :: 3.10
3939
Classifier: Programming Language :: Python :: 3.11
4040
Classifier: Programming Language :: Python :: 3.12
41+
Requires-Python: >=3.8
4142
Description-Content-Type: text/markdown
4243
License-File: LICENSE
4344
Requires-Dist: typing-extensions; python_version < "3.10"

contrib/python/Automat/py3/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(24.8.0)
5+
VERSION(24.8.1)
66

77
LICENSE(MIT)
88

contrib/python/cachetools/py3/.dist-info/METADATA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: cachetools
3-
Version: 5.4.0
3+
Version: 5.5.0
44
Summary: Extensible memoizing collections and decorators
55
Home-page: https://github.com/tkem/cachetools/
66
Author: Thomas Kemmer

contrib/python/cachetools/py3/cachetools/__init__.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"cachedmethod",
1414
)
1515

16-
__version__ = "5.4.0"
16+
__version__ = "5.5.0"
1717

1818
import collections
1919
import collections.abc
@@ -26,7 +26,6 @@
2626

2727

2828
class _DefaultSize:
29-
3029
__slots__ = ()
3130

3231
def __getitem__(self, _):
@@ -378,7 +377,6 @@ class TTLCache(_TimedCache):
378377
"""LRU Cache implementation with per-item time-to-live (TTL) value."""
379378

380379
class _Link:
381-
382380
__slots__ = ("key", "expires", "next", "prev")
383381

384382
def __init__(self, key=None, expires=None):
@@ -469,19 +467,26 @@ def ttl(self):
469467
return self.__ttl
470468

471469
def expire(self, time=None):
472-
"""Remove expired items from the cache."""
470+
"""Remove expired items from the cache and return an iterable of the
471+
expired `(key, value)` pairs.
472+
473+
"""
473474
if time is None:
474475
time = self.timer()
475476
root = self.__root
476477
curr = root.next
477478
links = self.__links
479+
expired = []
478480
cache_delitem = Cache.__delitem__
481+
cache_getitem = Cache.__getitem__
479482
while curr is not root and not (time < curr.expires):
483+
expired.append((curr.key, cache_getitem(self, curr.key)))
480484
cache_delitem(self, curr.key)
481485
del links[curr.key]
482486
next = curr.next
483487
curr.unlink()
484488
curr = next
489+
return expired
485490

486491
def popitem(self):
487492
"""Remove and return the `(key, value)` pair least recently used that
@@ -508,7 +513,6 @@ class TLRUCache(_TimedCache):
508513

509514
@functools.total_ordering
510515
class _Item:
511-
512516
__slots__ = ("key", "expires", "removed")
513517

514518
def __init__(self, key=None, expires=None):
@@ -583,7 +587,10 @@ def ttu(self):
583587
return self.__ttu
584588

585589
def expire(self, time=None):
586-
"""Remove expired items from the cache."""
590+
"""Remove expired items from the cache and return an iterable of the
591+
expired `(key, value)` pairs.
592+
593+
"""
587594
if time is None:
588595
time = self.timer()
589596
items = self.__items
@@ -592,12 +599,16 @@ def expire(self, time=None):
592599
if len(order) > len(items) * 2:
593600
self.__order = order = [item for item in order if not item.removed]
594601
heapq.heapify(order)
602+
expired = []
595603
cache_delitem = Cache.__delitem__
604+
cache_getitem = Cache.__getitem__
596605
while order and (order[0].removed or not (time < order[0].expires)):
597606
item = heapq.heappop(order)
598607
if not item.removed:
608+
expired.append((item.key, cache_getitem(self, item.key)))
599609
cache_delitem(self, item.key)
600610
del items[item.key]
611+
return expired
601612

602613
def popitem(self):
603614
"""Remove and return the `(key, value)` pair least recently used that

contrib/python/cachetools/py3/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(5.4.0)
5+
VERSION(5.5.0)
66

77
LICENSE(MIT)
88

0 commit comments

Comments
 (0)