This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ConnyOnny
Recipients ConnyOnny
Date 2014-12-11.13:59:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418306376.38.0.155577623227.issue23030@psf.upfronthosting.co.za>
In-reply-to
Content
In an effort for improved communication between stacked decorators, I would like to propose that all decorators providing caching mechanisms should provide the functions cache_info, cache_clear, cache_get and cache_put. The standard lib only provides functools.lru_cache as caching decorators, which already implements the former two. I have attached a patch to provide the latter two.

On python-ideas there was also the idea to create a cache data structure and then have a decorator take its data structure as an argument. But it was argued that this could lead to some optimizations of the caching being impossible.

I think my suggested approach should not impose a problem on highly optimized caching code, because every cache - no matter how optimized - must have some functionality to add something to the cache and lookup something in the cache.
History
Date User Action Args
2014-12-11 13:59:36ConnyOnnysetrecipients: + ConnyOnny
2014-12-11 13:59:36ConnyOnnysetmessageid: <1418306376.38.0.155577623227.issue23030@psf.upfronthosting.co.za>
2014-12-11 13:59:36ConnyOnnylinkissue23030 messages
2014-12-11 13:59:35ConnyOnnycreate