def length(iterable):
    """
    Return number of elements in iterable. Consumes iterable!

    >>> length(range(10))
    10

    :param iterable iterable: Any iterable, e.g. list, range, ...
    :return: Length of iterable.
    :rtype: int
    """
    return sum(1 for _ in iterable)