I'd like to have a class that contains a function that is called whenever another class function is called. And the tricky part is that I'd like this to work for derived classes.
Let's say:
def class A:
def __init__(self):
pass
def b(self):
print("Hello")
and
def class B(A):
def __special_method__(self):
print("Before Hello")
And calling object.b() would print
Before Hello
Hello
Is this even possible?