Python: just use `partial`!
One of my opinionated rules for making Python APIs intended for general use is to never take a callable and arguments to that callable in the same function signature, unless I need to modify those arguments before the callable gets them.
Every other alternative has some exception to what can be passed by position or by name, either to my function or through my function to the other callable. This is a trade-off which prioritizes common-case intuition and write convenience over the kind of logical regularity that helps ensure that code is actually correct in all cases.
Also, if I see
f(partial(g, foo, bar=qux))
then I know that `foo` and `bar=qux` are meant for `g` and not `f`, and that basically `f` has no say in the matter. But if I see
f(g, foo, bar=qux)
then I can't know from just the code logic if any of those arguments are intended for `g`, or if `f` will do something to them even if they are.











