def fold(func, iterable, initial=None, reverse=False):
    x = initial
if reverse:
    iterable = reversed(iterable)
for e in iterable:
    x = func(x, e) if x is not None else e
return x
python : can reduce be translated into list comprehensions like map, lambda and filter?