From d35ec71c4e694db83fc5ecedc8e3f11a3dd39749 Mon Sep 17 00:00:00 2001 From: Jay Hutchinson Date: Wed, 18 Mar 2015 02:08:38 -0500 Subject: lrudecorator now updates the metadata to look more like the wrapped function. Fixes #10 --- pylru.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylru.py b/pylru.py index 5cb4130..eef0593 100644 --- a/pylru.py +++ b/pylru.py @@ -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) -- cgit v1.2.1