if time_val == 'init':
    time_val = self.time
if self.time != time_val:
    print('The value of time has changed from ' + str(time_val) + ' to ' + str(
        self.time))
python signal when a variable change?