title: get a class name of calling method
body: <p>I know how to get a caller method name (from here: <a href="https://stackoverflow.com/questions/2654113/how-to-get-the-callers-method-name-in-the-called-method">How to get the caller&#39;s method name in the called method?</a>)</p>
  
  <pre><code>import sys
  print sys._getframe().f_back.f_code.co_name
  </code></pre>
  
  <p>What I'd like to get is the class name this method belongs to (assuming that it is in the class). 
  So if:</p>
  
  <pre><code>def get_some_info():
      print('Class name of caller:', XXX)
  
  class Base:
       def my_method(self):
           get_some_info()
  
  class A(Base):
       pass
  
  class B(Base):
       pass
  
  a = A()
  b = B()
  a.my_method()
  b.my_method()
  </code></pre>
  
  <p>should return:</p>
  
  <pre><code> ... A
   ... B
  </code></pre>
  
  <p>What should I do in <code>xxx</code>?</p>
  
  <p>I tried (using info on <code>_getframe</code>) do something like:</p>
  
  <pre><code> sys._getframe().f_back.f_code.__self__
  </code></pre>
  
  <p>but it doesn't work</p>
  
  <p>UPDATE:</p>
  
  <p>I cannot pass class name to a called function (otherwise that would be easy, but thanks to all who suggested this solution!)</p>