I need to map enum to enum class States(Enum): INIT = 0 LISTEN = 1 HANDSHAKE = 2 so that I have transitions dictionary from one state to another: transitions: Dict[States, States] = { States.INIT: States.LISTEN, States.LISTEN: States.HANDSHAKE, States.HANDSHAKE: States.HANDSHAKE, } I start with state = States.INIT but then this never evaluates to true: if state in transitions: do_this() What do I need to correct? Continue reading...