import itertools


def drop_last(n: int):
    """Drops the last n elements of a sequence.

    >>> tuple(drop_last(1)([1,2,3,4,5]))
    (1,2,3,4)
    """

    def drop_last(seq):
        return itertools.islice(seq, len(seq) - n)

    return drop_last