diff options
author | Thomas Kemmer <tkemmer@computer.org> | 2014-12-19 18:30:57 +0100 |
---|---|---|
committer | Thomas Kemmer <tkemmer@computer.org> | 2014-12-19 18:30:57 +0100 |
commit | 886f48e8e5e552d0d7df352ce2f0fff0130e4566 (patch) | |
tree | f4dbe640bf1cf07b3a5b96664d8a755c09537978 /README.rst | |
parent | cedcfccaa127dbe4d4208fd13919ff68529a4193 (diff) | |
download | cachetools-886f48e8e5e552d0d7df352ce2f0fff0130e4566.tar.gz |
Update README.rst
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -21,14 +21,15 @@ function decorator. >>> cache LRUCache([('second', 2), ('fourth', 4)], maxsize=2, currsize=2) - For the purpose of this module, a *cache* is a mutable_ mapping_ of a -fixed maximum size. When the cache is full, i.e. the size of the -cache would exceed its maximum size, the cache must choose which -item(s) to discard based on a suitable `cache algorithm`_. A cache's -size is the sum of the size of its items, and an item's size in -general is a property or function of its value, e.g. the result of -``sys.getsizeof``, or ``len`` for string and sequence values. +fixed maximum size. When the cache is full, i.e. by adding another +item the cache would exceed its maximum size, the cache must choose +which item(s) to discard based on a suitable `cache algorithm`_. In +general, a cache's size is the total size of its items, and an item's +size is a property or function of its value, e.g. the result of +``sys.getsizeof(value)``. For the trivial but common case that each +item counts as ``1``, irrespective of its value, a cache's size is +equal to the number of its items, or ``len(cache)``. This module provides multiple cache implementations based on different cache algorithms, as well as decorators for easily memoizing function |