Given a simple curried function
import toolz
@toolz.curry
def mklist(x, y, z):
return [x, y, z]
obviously calling mklist(x=1, y=2)(z=3)
works.
What I would like to be able to do is to call the function like so: mklist(x=1, y=2)(3)
, where z gets bound to 3.
This errors with TypeError: mklist() got multiple values for argument 'x'
since passing a positional argument apparently tries to assign the argument to the first paramter (x).
How can it be made so that the final positional argument of a curried function gets passed to the last remaining parameter?