<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subscribe(self, handler):
 """Adds a new event handler."""

        assert callable(handler), "Invalid handler %s" % handler
        self.handlers.append(handler)