I didn't realize def foo(x, y=[]) had this strange artifact but it totally 
makes sense, TIL. I did not get the right idea reading the PEP though, since 
currently the motivation reads:

> Optional function arguments, if omitted, often have some sort of logical 
> default value. When this value depends on other arguments, or needs to be 
> reevaluated each function call, there is currently no clean way to state this 
> in the function header.

and I kinda glossed over the second use-case. I feel like more emphasis can be 
added since that part is what necessitates the new syntax.

I do think that being able to reference other arguments is very useful in it's 
own right and would go a long way in helping to solve the None check problem 
brought up in PEP 505 even more cleanly.
_______________________________________________
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/D4DP4UB7LPYPBNPTXIZDRVD6NOPMGPQP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to