def butlast(seq):
    it = iter(seq)
    try:
        prev = next(it)
    except __HOLE__:
        pass
    else:
        for item in it:
            yield prev
            prev = item
dataset/ETHPy150Open Suor/funcy/funcy/seqs.py/butlast