def compare(left, right):
    """
    generator emiting pairs indicating the contents of the left and
    right directories. The pairs are in the form of (difference,
    filename) where difference is one of the LEFT, RIGHT, DIFF, or
    BOTH constants. This generator recursively walks both trees.
    """

    dc = dircmp(left, right, ignore=[])
    return _gen_from_dircmp(dc, left, right)