by yen223 · 2y ago · 0 comments
It's a shame the only language that did partial application well is, weirdly, Python.
I guess you were talking about `functools.partial`, which is basically the same as currying and also only works on the last arguments. It's better to use lambda functions.
Also Python is far from the only language to have a function like that, e.g. see C++'s `std::bind` which nobody* uses since lambdas were supported.
*standard HN disclaimer
I was talking about `functools.partial` yes, but it can work on any arguments in order, using keyword arguments.
e.g.
def copy(source, dest):
.....
copy_to_temp = partial(copy, dest="/tmp/")
copy_from_temp = partial(copy, source="/tmp/")