Functools.update_wrapper() doesn't work properly
问题 I use Functools.update_wrapper() in my decorator, but It seems like update_wrapper rewrites only function attributes (such as __doc__ , __name__ ), but does not affect on help() function. I aware of these answers, but they don't work with decorator-class. Here is my function. import functools class memoized(object): def __init__(self, func): self.func = func functools.update_wrapper(self, func) def __call__(self, *args): self.func(*args) @memoized def printer(arg): "This is my function" print