In this code the grouper function works fine, however if I do it without calling the function. It throws a error
TypeError: izip_longest argument #1 must support iteration
from itertools import *
def grouper(n, iterable, fillvalue=None):
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)
x = [1,2,3]
args = [iter(x)] * 2
l = izip_longest(None , *args )
#l = grouper(2,x)
print [x for x in l]