def fn(state, goal, operators): h, ha = ff(state, goal, operators) yield h, ha yield h, set(ha_applicable(state, goal, operators)) - set(ha)
def fn(state, goal, operators): h, ha = ff(state, goal, operators) return h, ha + list(set(ha_applicable(state, goal, operators)) - set(ha))