dgilland / cacheout

A caching library for Python
https://cacheout.readthedocs.io
MIT License
425 stars 44 forks source link

Add method to calculate the cache key for decorated function arguments #15

Closed johnbergvall closed 3 years ago

johnbergvall commented 3 years ago

When using the memoize decorator there is currently no way to modify cached items further (e.g. delete/update a single item) or check if an item exists.

This pull requests add an attribute to the decorated function to generate the same cache key for the provided arguments as when the function is called, to allow using all other operations of the underlying cache object.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 37b441c93590d0bd8c623f2bde81f30c694ed537 on johnbergvall:master into 797952bffb35d75c86f0bdf04d78adffd3d34430 on dgilland:master.

dgilland commented 3 years ago

Thanks for the new feature! Very appreciated! 👍

dgilland commented 3 years ago

These changes are in 0.13.0: https://pypi.org/project/cacheout/0.13.0/