One function
mru_cache in tkem/cachetools
The author described this change as “Fix #256: Deprecate @mru_cache decorator.”. It counts as a record because the check below fails on the code as it stood at 8f0d74a14 and passes on d3598664c, with nothing else changed between the two runs.
Projecttkem/cachetools
Fix saved2024-07-15
Sharing licenceMIT · LICENSE
Change size+4 −0
What the code was meant to do, written into the code itself as a docstring
Decorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a Most Recently Used (MRU) algorithm.
The change
| 3 | 3 | up to `maxsize` results based on a Most Recently Used (MRU) | |
| 4 | 4 | algorithm. | |
| 5 | 5 | """ | |
| 6 | + | from warnings import warn | |
| 7 | + | ||
| 8 | + | warn("@mru_cache is deprecated", DeprecationWarning, stacklevel=2) | |
| 9 | + | ||
| 6 | 10 | if maxsize is None: | |
| 7 | 11 | return _cache({}, None, typed) | |
| 8 | 12 | elif callable(maxsize): |
The check that tells the two apart
fail→pass·tests/test_func.py::MRUDecoratorTest::test_decorator
Check file tests/test_func.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it8f0d74a145f90e2672371b61aa8f82614adeefd7
Broken version dated2024-07-15
Modulecachetools.func
Units changedmru_cache
Fingerprint89441cdef5acb15b
Checked2026-08-17 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in tkem/cachetools
- 2026-07-22TLRUCache
- 2026-03-08Fix #218: Fix and properly document @cachedmethod.cache_key handling.
- 2026-03-05_DescriptorBase
- 2024-08-18Fix #292, fix #205, fix #103: TTLCache.expire() returns iterable of expired (key, value) pairs.
- 2021-12-21Fix #159: Pass self to @cachedmethod key function.
- 2021-12-18TTLCache