def all_equal(iterable):
    """Return True if all elements in `iterable` are equal.

    Also returns True if iterable is empty.
    """
    iterator = iter(iterable)
    try:
        first = next(iterator)
    except StopIteration:
        return True  # vacuously True

    return all(element == first for element in iterator)