def interleave(joiner, iterable):
    """
    Similar to `str.join` but for lists.

    >>> interleave([1], [2, 3, 4])
    [2, 1, 3, 1, 4]
    """
    try:
        yield next(iterable)
    except StopIteration:
        return
    for item in iterable:
        yield joiner
        yield item
