import itertools


def natatime(n, iterable, fillvalue = None):
	"""Returns an iterator yielding `n` elements at a time.
	:param n: the number of elements to return at each iteration
	:param iterable: the iterable over which to iterate
	:param fillvalue: the value to use for missing elements
	:Example:
	>>> for (a,b,c) in natatime(3, [1,2,3,4,5], fillvalue = "?"):
		...   print a, b, c
		...
	1 2 3
	4 5 ?
	"""
	stepped_slices = ( itertools.islice(iterable, i, None, n) for i in range(n) )
	return itertools.zip_longest(*stepped_slices, fillvalue = fillvalue)