def _weave_conflicting_selectors(prefixes, a, b, suffix=()):
    """Part of the selector merge algorithm above.  Not useful on its own.  Pay
    no attention to the man behind the curtain.
    """
    both = a and b
    for prefix in prefixes:
        yield prefix + a + b + suffix
        if both:
            yield prefix + b + a + suffix
