def count(iterable):
    """
	Count the number of items produced by the iterable. Calling this function
	will exhaust the iterator.
	"""
    count = 0
    for item in iterable:
        count += 1
    return count
