I'm pretty new to python, but I'd like to go through and understand each step in your function.
the first line is a function definition which takes arbitrary arguments -had to look up the operator, woohoo learning
the second line starts with a declaration of lambda, which I assume is an inline temporary function. it looks like it is diveintpython
it takes an argument x, and returns a reduce function. I'm going out on a limb and guessing this reduce is something like the map/reduce from google and lisp and is some kinda cumulative function... reduce and other python builtin functions
reduce(function, iterable[, initializer])
Apply function of two arguments cumulatively to the items of iterable, from left to right, so as to reduce the iterable to a single value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5). The left argument, x, is the accumulated value and the right argument, y, is the update value from the iterable. If the optional initializer is present, it is placed before the items of the iterable in the calculation, and serves as a default when the iterable is empty. If initializer is not given and iterable contains only one item, the first item is returned.
so reduce iteratively applies the passed in function, another lambda, to an array of arguments. the passed in function takes two arguments a,b and applies b to a
The iterable (fs+x)[::-1] has me confused, is it decrementing from the last arg? cycle through fs args (functions) one at a time until the index is -1 and keep applying it.
so magic_function(foo,bar)(x) would return
a function, foo(bar(x)) or is the order swapped and it returns bar(foo(x))
this matches up with what null_ptr identified