On Mon, Mar 22, 2021 at 1:28 PM Caleb Donovick firstname.lastname@example.org wrote:
... One could do something like:
def fun(a, b=0): ... def wraps_fun(args, b=inspect.signature(fun).parameters['b'].default): ...
But I would hardly call that clear.
I like this approach too - it just needs a cleaner syntax. Python could make functions more "object like" by having fields for args (though I'm sure that would inspire some controversy):
def fun(a, b=0): ... def wraps_fun(args, b=fun.args.b.default): ...