diff options
author | Jay Hutchinson <jlhutch@gmail.com> | 2015-03-18 02:08:38 -0500 |
---|---|---|
committer | Jay Hutchinson <jlhutch@gmail.com> | 2015-03-18 02:11:41 -0500 |
commit | d35ec71c4e694db83fc5ecedc8e3f11a3dd39749 (patch) | |
tree | 0a71d6e042f09e5e91361ebdf2fff9af95687c95 | |
parent | 7bdea5954a537245ecb5b9bb6cb446805f7e2578 (diff) | |
download | pylru-d35ec71c4e694db83fc5ecedc8e3f11a3dd39749.tar.gz |
lrudecorator now updates the metadata to look more like the wrapped function.
Fixes #10
-rw-r--r-- | pylru.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -531,10 +531,12 @@ def lruwrap(store, size, writeback=False): else: return WriteThroughCacheManager(store, size) +import functools class lrudecorator(object): def __init__(self, size): self.size = size def __call__(self, func): - return FunctionCacheManager(func, self.size) + wrapper = FunctionCacheManager(func, self.size) + return functools.update_wrapper(wrapper, func) |