How do I find out a name of class that created an instance of an object in Python if the function I am doing this from is the base class of which the class of the instance h
type() ?
>>> class A(object): ... def whoami(self): ... print type(self).__name__ ... >>> >>> class B(A): ... pass ... >>> >>> >>> o = B() >>> o.whoami() 'B' >>>