Python-LRU-cache:python的内存LRU缓存

时间:2021-05-01 01:54:29
【文件属性】:
文件名称:Python-LRU-cache:python的内存LRU缓存
文件大小:17KB
文件格式:ZIP
更新时间:2021-05-01 01:54:29
Python master分支构建状态: 介绍 拥有内存中的缓存通常很有用。 当然,也希望不要使缓存变得太大,并且通常希望使缓存过期。 该模块提供了这样的缓存。 在大多数情况下,您可以像这样使用它: from lru import lru_cache_function @ lru_cache_function ( max_size = 1024 , expiration = 15 * 60 ) def f ( x ): print "Calling f(" + str ( x ) + ")" return x f ( 3 ) # This will print "Calling f(3)", will return 3 f ( 3 ) # This will not print anything, but will return 3 (unless 15 minutes have
【文件预览】:
Python-LRU-cache-master
----.gitignore(62B)
----setup.cfg(39B)
----README.md(2KB)
----lru()
--------__init__.py(8KB)
----LICENSE(33KB)
----AUTHORS(35B)
----setup.py(457B)
----.travis.yml(394B)

网友评论