Is the => syntax needed? as far as I can think of, the only time where late 
evaluation is needed is when the expression references the other arguments. So 
the rule “if the expression reference other arguments it will get evaluated at 
function call time” should suffice right?

In effect:
    def foo(a, b=len(a), c=max(b, d), d=15):
gets translated into
    def foo(a, b=None, c=None, d=15):
        if b is None:
            b = len(a)
        if c is None:
            c = max(b, d)

I’m not sure if this is already brought up in previous emails, I tried my best 
to search for it but can’t find any reference.

Also, I think the sepc should not leave any ambiguous behavior otherwise it 
creates subtle incompatibilities when people use different implementations. 
This goes for whether all other argument can be referenced or only some 
argument can be. Or if the use of outer scope variables should get evaluated at 
def time, something like foo(a, b=max(a, outer.length())) should length() be 
ran once or on every function call. Stuff like these create an functional 
effect to the user so they ought to be well defined and not implementation 
specific.
_______________________________________________
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/ENILUNXZUIAI4OOH6XLHLFYHXOAHO4JY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to