def pairwise(iterable):
    a, b = itertools.tee(iterable)
next(b, None)
return a, b

def sum_products(l):
    return sum(map(operator.mul, *pairwise(l)))
Can this be written as a python reduce function?