4 ms·
Partial application just means fixing some arguments. My point was you can do that easily using lambda functions. I guess you were talking about `functools.par
by IshKebab 3y ago
Partial application just means fixing some arguments. My point was you can do that easily using lambda functions.
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
- yen223 3y ago> I guess you were talking about `functools.partial`, which is basically the same as currying and also only works on the last arguments 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/")