0
Can anyone explain what functools.partial do?
4 ответов
+ 2
partial() can be used to sort of hard-code some default arguments when calling a function.
I meddled with it in this code:
https://code.sololearn.com/cBZ8CthiaJ8h/?ref=app
It could be useful also if you have a function that takes two arguments, and you have to use it in a situation where a function with a single argument is expected, as in parameter of higher order functions like filter, map, reduce.
0
I did got some examples but not clear yet. I understand it shortens some effort by merging key args?
0
I did got some examples but not clear yet. I understand it shortens some effort by merging key args?