diff --git a/rocketpy/simulation/events.py b/rocketpy/simulation/events.py index 13b775725..011b9125c 100644 --- a/rocketpy/simulation/events.py +++ b/rocketpy/simulation/events.py @@ -154,8 +154,14 @@ def __verify_action(self, action): return action def __repr__(self): - # TODO: Implement a more informative string representation of the Event object. - pass + # .__self__ gets the Flight object + # .__name__ gets the function name 'handle_out_of_rail_event' + return ( + f"Event(name={self.name!r}, " + f"trigger={self.trigger.__name__}, " + f"action={self.action.__self__.__class__.__name__}.{self.action.__name__}, " + f"event_context={self.event_context})" + ) def __str__(self): # TODO: Implement a more informative string representation of the Event object.