I tried to change my original code with this set comprehension
next_states = {next_states | self.transition_function[(state,
input_value)] for state in e_closure_states}
But this code throws
TypeError: unhashable type: 'set'
Original code (working as expected). Also, it should be mentioned that self.transition_function[(state, input_value)]
is set and that's why I am using union. Thanks in advance
for state in e_closure_states:
next_states = next_states | self.transition_function[(state, input_value)]