In Python, is it possible for an instance method to know the name of the class which is calling it? For example, in the sample below, I would like for the someMethod method to print the name of the class calling it ("bar" in the first case, "again" in the second).
--------------------------------------- class foo(): def someMethod(self): print x class bar(): def __init__(self): f = foo() f.someMethod() class again(): def __init__(self): f = foo() f.someMethod() bar() again() ---------------------------------------
-- http://mail.python.org/mailman/listinfo/python-list