Like str.join, but yields an iterable.

def join(iterable, sep):
    """Like str.join, but yields an iterable."""
    i = 0
    for i, item in enumerate(iterable):
        if i == 0:
            yield item
        else:
            yield sep
            yield item