aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kemmer <tkemmer@computer.org>2020-12-09 19:19:02 +0100
committerThomas Kemmer <tkemmer@computer.org>2020-12-09 23:38:17 +0100
commit59ff52c872ba88206abf8256e95e6ccbd8694544 (patch)
tree32b08acd99d6f9f27b1874daed36d852ad00cd9f
parent55d67e6e19fd4e11a7cfe21e517c7e8d5e7ee10d (diff)
downloadcachetools-59ff52c872ba88206abf8256e95e6ccbd8694544.tar.gz
Add MRU documentation.
-rw-r--r--docs/index.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst
index e27c9bc..8728c83 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -81,6 +81,12 @@ of one argument used to retrieve the size of an item's value.
This class discards the least recently used items first to make
space when necessary.
+.. autoclass:: MRUCache(maxsize, getsizeof=None)
+ :members:
+
+ This class discards the most recently used items first to make
+ space when necessary.
+
.. autoclass:: RRCache(maxsize, choice=random.choice, getsizeof=None)
:members:
@@ -465,6 +471,13 @@ all the decorators in this module are thread-safe by default.
saves up to `maxsize` results based on a Least Recently Used (LRU)
algorithm.
+.. decorator:: mru_cache(user_function)
+ mru_cache(maxsize=128, typed=False)
+
+ Decorator that wraps a function with a memoizing callable that
+ saves up to `maxsize` results based on a Most Recently Used (MRU)
+ algorithm.
+
.. decorator:: rr_cache(user_function)
rr_cache(maxsize=128, choice=random.choice, typed=False)