how lambda works with reduce
问题 I was trying to understand how reduce works through this website. The example they have mentioned is quite good and easy to understand. http://book.pythontips.com/en/latest/map_filter.html#reduce a = reduce((lambda x, y: x * y), [1, 2, 3, 4]) The above function will multiple each and every number in list and assign to a . However, I got totally stumped when I came across following function in project. def compose(*fns): return reduce(lambda acc, fn: lambda *args: acc(fn(*args)), fns, lambda _