This code is an example for how to implement a simple State Machine using just standard Python (no library)
This State Machine supports :
- all possible kinds of transitions
- entry and exit methods
- simple declarative code
- easy modification of behavior
- easy to understand
- easy and intuitive to implement
- variable delay in execution
when creating the functions for the states I named them differently [run0, run1, run2, ...]
As in python function-names are just variables you could just override the same function over and over.