Files
sync-prototyping-1/synctoy/state_machine.py

12 lines
349 B
Python

from typing import Protocol
class StateMachine(Protocol):
def equivalent_to(self, other: "StateMachine") -> bool:
raise NotImplementedError
def can_transition_from(self, old: "StateMachine") -> bool:
raise NotImplementedError
def can_transition_to(self, new: "StateMachine") -> bool:
raise NotImplementedError