python pro for state-machines