python-diskcache
python-diskcache copied to clipboard
cache.incr does not support tagging
I am using tags to manage and evict keys based on their tags. However, I noticed that cache.incr does not accept a tag parameter, resulting in all keys created by cache.incr having a None tag.
Current workaround:
try:
cache.incr(key, delta, default=None)
except KeyError:
cache.set(key, delta, tag='counter')
Proposed enhancement: It would be more straightforward and efficient if cache.incr could accept a tag parameter, allowing:
cache.incr(key, delta, tag='counter')
This enhancement would simplify the code and ensure consistency in tagging keys.