def subpositions(G):
    """
        Return an iterator over all subpositions of G.

        Yields
        ------
        g : Game
            A subposition of G.
        """
    for g in (G._left | G._right):
        yield g
        yield from g.subpositions()
