def __iter__(self) -> Iterator[Transition]:
        """Iterate over the transitions produced by :meth:`_generate_transitions`.

        .. note::
            Merge two transitions of the same type to a single one.

            This is always safe because skipping the first transition is equivalent
            to no one observing the intermediate state.

        :yields: transitions as :class:`Transition` objects.
        """
        transitions = list(self._generate_transitions())
        for cur_transition, next_transition in zip(transitions, transitions[1:] + [None]):
            if isinstance(next_transition, Transition) \
                    and cur_transition.transition_type == next_transition.transition_type:
                continue
            yield cur_transition
            if cur_transition.transition_type == 'restart':
                break
Iterate over the transitions produced by :meth:`_generate_transitions`.

        .. note::
            Merge two transitions of the same type to a single one.

            This is always safe because skipping the first transition is equivalent
            to no one observing the intermediate state.

        :yields: transitions as :class:`Transition` objects.
        
patroni/quorum.py