title: Get the class name of a decorated class method
body: <p>Consider this scenario:</p>
  
  <pre><code>import functools
  
  def wrapmethod(f):
      @functools.wraps(f)
      def wrap(*args, **kwargs):
          print '&gt;&gt; %s' % (f.func_name)
  
          # Here I'll do pre-processing
          r = f(*args, **kwargs)
          # Here I'll do post-processing
  
          return r
  
      return wrap
  
  @wrapmethod
  def foo():
      pass
  
  class Test(object):
      @wrapmethod
      def foo(self):
          pass
  
  test = Test()
  test.foo()
  foo()
  </code></pre>
  
  <p>It'll output this, as you can see executed in <a href="http://codepad.org/Y4xXyjJO" rel="noreferrer">http://codepad.org/Y4xXyjJO</a>:</p>
  
  <pre>>> foo
  >> foo</pre>
  
  <p>I want to know a way to print out <code>Test.foo</code> in the first line, indicating the class which the method is linked to.</p>
  
  <p>Any ideas? Is it ever possible?</p>
  
  <p>Thank you in advance.</p>