`self.actions` could be a `collection.deque` for constant-time `append` and `pop(0)` operations.