Python statechart support