self._attr.on_change = self._on_change

@property
def attr(self):
    return self._attr

@attr.setter
def attr(self, value):
    if self._attr != value:
        self._on_change()
self._attr = value

def _on_change(self):
    print('Do some code here every time attr changes')
Catching changes to a mutable attribute in python