
Nov. 14, 2021
5:14 p.m.
On Mon, Mar 22, 2021 at 1:28 PM Caleb Donovick <donovick@cs.stanford.edu> 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.
Caleb
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): ...