""" Concrete States implement various behaviors, associated with a state of the Context. """ from behavioral.state.state import State class ConcreteStateA(State): def handle1(self) -> None: print("ConcreteStateA handles request1.") print("ConcreteStateA wants to change the state of the context.") self.context.transition_to(ConcreteStateB()) def handle2(self) -> None: print("ConcreteStateA handles request2.") class ConcreteStateB(State): def handle1(self) -> None: print("ConcreteStateB handles request1.") def handle2(self) -> None: print("ConcreteStateB handles request2.") print("ConcreteStateB wants to change the state of the context.") self.context.transition_to(ConcreteStateA())