Python state machine
Was doing a graph-like stucture to easily explain a really complex decision tree that’s not really a tree, but I was really looking for an existing thing: A state machine!
And it’s even an existing programming pattern: StateMachine — Python 3 Patterns, Recipes and Idioms
The book I didn’t know I needed!
Anyway, existing implementations:
- GitHub - fgmacedo/python-statemachine: Python Finite State Machines made easy.
- GitHub - pytransitions/transitions: A lightweight, object-oriented finite state machine implementation in Python with many extensions
I really like how feature-complete and documented transitions
is - callbacks etc.
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus