A *very* simple Python implementation of a DFA