When should I use function currying in Python?
问题 When should I write my functions in curried form? does not match my thought, need to correct myself. As part of my learning link, this is what I understand from function currying. Below is one example: def curry2(f): """Returns a function g such that g(x)(y) == f(x, y) >>> from operator import add >>> add_three = curry2(add)(3) >>> add_three(4) """ def g(x): def h(y): return f(x, y) return h return g In any application, if I know that the number of arguments are fixed (say 2 arguments) and