def test_list_reduce(lst, dflt): def f(a, b): return a + b return list_reduce(f, lst, dflt)
def test_prim_list_reduce(l): def add(a, b): return a + b return list_reduce(add, l, 4)