Ben Hoyt added the comment:
I really like this idea (and am needing this functionality), but I don't think
this API (or implementation) is very nice:
1) It means you have to change your function signature to use the timeout
feature.
2) Specifying the interval in minutes seems odd (most
Peter Santoro added the comment:
As requested, I published this for review on
http://code.activestate.com/recipes/578817-lru_timestamp-cache-entry-aging-for-functoolslru_c/
--
___
Python tracker rep...@bugs.python.org
Raymond Hettinger added the comment:
Please publish this outside the standard library so it can mature and get user
feedback. I think it would be premature to add it right now. The subject of
cache entry invalidation or expiration is broad. I'm not sure this is the best
way to do it.
Raymond Hettinger added the comment:
This is a pretty interesting idea.
Ideally, it would be great if it could be a published as a recipe somewhere so
that people could experiment with the API and try out variations. If there
were good uptake by users, it would help justify a proposal to be
Peter Santoro added the comment:
I updated my proposed lru_timestamp function with the following change:
1) raise TypeError instead of ValueError
--
Added file: http://bugs.python.org/file31079/lru.py
___
Python tracker rep...@bugs.python.org
New submission from Peter Santoro:
The attached proposed lru_timestamp function provides developers with more
control over how often lru_cache entries are refreshed. Doc string follows:
def lru_timestamp(refresh_interval=60):
Return a timestamp string for @lru_cache decorated functions.
Peter Santoro added the comment:
I updated my proposed lru_timestamp function with the following changes:
1) restricted refresh_interval to int type
2) updated doc string
Updated doc string follows:
def lru_timestamp(refresh_interval=60):
Return a timestamp string for @lru_cache
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
nosy: +rhettinger
versions: +Python 3.4 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18577