You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decorator to wrap a function with a memoizing callable that saves up to the maxsize most recent calls. It can save time when an expensive or I/O bound function is periodically called with the same arguments.
我注意到 @huangrihang 经常增加一些计数变量。类似的需求,我们有必要规范缓存方案。
根据StackOverflow的回答,有几个备选方案:
functools
的lru_cache
。它的功能似乎不是我们直接需要的。不过有基于它直接实现的库,比如cachetools
beaker
: 这是一个用在Web应用的缓存框架。pymemcache
也是一个比较主流的方案。cachesql
: SQL缓存。The text was updated successfully, but these errors were encountered: