我希望能够监视变量并在更改类的实例时调用类中的函数。
class Example:
def __init__(self, content):
self.content = content
example1 = Example('testing')
example1.content = 'testing123'
Run Code Online (Sandbox Code Playgroud)
我希望能够检查是否example1.content已更改/更新,如果已更改,请运行一些代码。