def expand(cls: list, bounds: list):
    """ Given a class and a sorted sequence of codepoints, yield a stream of booleans indicating whether each codepoint is in the class. """
    idx = 0
    for x in bounds:
        while idx < len(cls) and x >= cls[idx]:
            idx += 1
        yield idx % 2
