> On 25 Oct 2021, at 08:08, Steven D'Aprano <[email protected]> wrote:
>
> I would say that it makes most sense to assign early-bound defaults
> first, then late-bound defaults, specifically so that late-bound
> defaults can refer to early-bound ones:
>
> def func(x=0, @y=x+1)
>
> So step 3 above should become:
In this case you do not need a new rule to make it work as in the left-to-right
order
x = 0 first.
def func(@y=x+1, @x=0):
Is it unreasonable to get a UnboundLocal or SyntaxError for this case?
I'm not convinced that extra rules are needed.
Barry
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/BAETFKAW6GJUC5G5LRNBEFAALUOJZP66/
Code of Conduct: http://python.org/psf/codeofconduct/