def reversed_enumerate(seq):
    """Like reversed(list(enumerate(seq))) without copying the whole seq."""
    return zip(reversed(range(len(seq))), reversed(seq))
Like reversed(list(enumerate(seq))) without copying the whole seq.
weasyprint/layout/block.py