Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Memoizing Decorator Support #9

Closed
grantjenks opened this issue Mar 28, 2016 · 5 comments
Closed

Add Memoizing Decorator Support #9

grantjenks opened this issue Mar 28, 2016 · 5 comments

Comments

@grantjenks
Copy link
Owner

grantjenks commented Mar 28, 2016

As described in DiskCache Development it would be great to have an lru_cache-like decorator to cache function calls.

I contacted Yuval Greenfield, the author of filecache and he said the missing decorator feature was what blocked him from using the module. His decorator accepts one argument, seconds before expiry.

I prototyped something simple in Issue #8. It should be relatively easy to combine it with the source from Python 3's functools.lru_cache

@grantjenks
Copy link
Owner Author

@grantjenks
Copy link
Owner Author

Needs "typed=False" parameter. See: https://bugs.python.org/issue13227

@tamirOK
Copy link
Contributor

tamirOK commented May 23, 2017

@grantjenks , does decorator have to store cached data on disk?

@grantjenks
Copy link
Owner Author

Yes, I would expect it to use core.Cache internally.

@grantjenks
Copy link
Owner Author

Deployed at 2.8.2

The new feature is at FanoutCache.memoize and DjangoCache.memoize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants