Open sdebionne opened 2 years ago
StateMachine may implement a state change logger (on_state_change method) as shown in the log example
StateMachine
on_state_change
class TurnstileWithLog(Turnstile): def __init__(self): super().__init__() self.history = [self.state] def on_state_change(self, source, target): if source != target: self.history.append(target)
that keeps an history of the distinct state changes.
I will had some documentation if the feature is accepted.
StateMachine
may implement a state change logger (on_state_change
method) as shown in the log examplethat keeps an history of the distinct state changes.
I will had some documentation if the feature is accepted.