Raise TransitionNotAllowed when appropriate, rather than NotImplementedError
PEP8