def postfixes(seq):
    """
    Generate all postfixes of a sequence.

    Examples
    ========

    >>> list(postfixes([1, 2, 3, 4]))
    [[4], [3, 4], [2, 3, 4], [1, 2, 3, 4]]

    """
    n = len(seq)
    for i in range(n):
        yield seq[n - i - 1:]
