On Mon, Mar 22, 2021 at 1:28 PM Caleb Donovick <donov...@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): ...
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/JEJVSDPJ65TBRDDMTRKP7ZIFFZ7GU5TT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to