4 ms·
I mean, it essentially is available though, "from functools import partial". I just have never seen any examples other than the perfunctory useless math ones:
by overgard 4y ago
I mean, it essentially is available though, "from functools import partial". I just have never seen any examples other than the perfunctory useless math ones:
mult_10 = partial(mult, 10)
mult_10_20 = partial(mult_10, 20)
print(mult_10_20(30))
The only context I can think of off the top of my head where currying might be useful is binding a "this" or "self" object, but, if I'm using a class I already get that. Maybe you could use it to pass through some set of context objects, but then, you could already do that by just creating a data structure to hold those objects.