Maybe the problem is in the DSL part? What if functools.partial could bind positional arguments in standard library functions like it can with user-defined ones without raising a TypeError, would that be a problem?
To be clear, in my previous comment I wasnât advocating for including better-partial (as it is currently implemented) in the standard library, rather for functions created via def to support a placeholder-like partial application syntax as a language feature.
I work a lot in a functional framework and I frequently run into situations where something like the syntax in better-partial would be useful.
I follow the rationale for leaving functools.partial alone, but
there is a specific awkwardness that I havenât seen highlighted:
Suppose I have a function:
def foo(a, b):
...
As a caller I can choose foo(3,4) or foo(a=3, b=4) based on terseness vs clarity.
However, I cannot choose between partial(foo, 3) and partial(foo, a=3).
The latter result cannot be called positionally, so it hasnât returned a
full-fledged partially bound version of foo. This isnât obvious.