def consume(iterator, n):
    """Advance the iterator n-steps ahead. If n is none, consume entirely."""
if n is None:
    collections.deque(iterator, maxlen=0)
Pythonic solution to drop N values from an iterator