title: Python functools.wraps equivalent for classes
body: <p>When defining a decorator using a class, how do I automatically transfer over<code>__name__</code>, <code>__module__</code> and <code>__doc__</code>?  Normally, I would use the @wraps decorator from functools.  Here's what I did instead for a class (this is not entirely my code):</p>
  
  <pre><code>class memoized:
      """Decorator that caches a function's return value each time it is called.
      If called later with the same arguments, the cached value is returned, and
      not re-evaluated.
      """
      def __init__(self, func):
          super().__init__()
          self.func = func
          self.cache = {}
  
      def __call__(self, *args):
          try:
              return self.cache[args]
          except KeyError:
              value = self.func(*args)
              self.cache[args] = value
              return value
          except TypeError:
              # uncacheable -- for instance, passing a list as an argument.
              # Better to not cache than to blow up entirely.
              return self.func(*args)
  
      def __repr__(self):
          return self.func.__repr__()
  
      def __get__(self, obj, objtype):
          return functools.partial(self.__call__, obj)
  
      __doc__ = property(lambda self:self.func.__doc__)
      __module__ = property(lambda self:self.func.__module__)
      __name__ = property(lambda self:self.func.__name__)
  </code></pre>
  
  <p>Is there a standard decorator to automate the creation of name module and doc?  Also, to automate the get method (I assume that's for creating bound methods?)  Are there any missing methods?</p>