def on(self, event, new_state):
        """
        add a valid transition to this state
        """
        if self.name == new_state.name:
            raise RuntimeError("Use loop method to define {} -> {} -> {}".format(self.name, event.name, new_state.name))
        self._register_transition(event, new_state)
def on ( self , event , new_state ) : if self . name == new_state . name : raise RuntimeError ( "Use loop method to define {} -> {} -> {}" . format ( self . name , event . name , new_state . name ) ) self . _register_transition ( event , new_state )
add a valid transition to this state