def all_equal(iterable):
    """are all elements of the iterable equal?"""
    iterator = iter(iterable)
    first = next(iterator)
    for item in iterator:
        if not item == first:
            return False
    return True