class A(object):
    def get_class(self):
        return self.__class__
class B(A):
    def __init__(self):
        A.__init__(self)
b = B()
print b.get_class()
This code will print <class '__main__.B'>.
How can I get the class name where the method has been defined (namely A)?
 
     
     
     
     
     
    