<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_rule(self, *args):
 """Make sure to update when the rule changes"""

        if self.rule is None:
            return
        self.rule.connect(self._listen_to_rule)