I'm trying to do something really ugly and need help. From some method, I'm trying to analyze the stack and identify which class called this method as described here. But I want to go one step further and update some attribute of the instance of the class that called my method.
Example:
class A(object):
self.a
def some_func():
analyze()
def analyze():
frm = inspect.stack()[1]
obj = find_obj_of_frm_by_magic(frm)
obj.a = 1