Get function callers' information in python

Viewed 6644

I want to get information about the callers of a specific function in python. For example:

class SomeClass():
    def __init__(self, x):
        self.x = x
    def caller(self):
        return special_func(self.x)

def special_func(x):
    print "My caller is the 'caller' function in an 'SomeClass' class."

Is it possible with python?

3 Answers
Related