On 2021-10-26 20:15, Chris Angelico wrote:
One of my goals here is to ensure that the distinction between
early-bound and late-bound argument defaults is, again, orthogonal
with everything else. You should be able to change "x=None" to "x=>[]"
without having to wonder whether you're stopping yourself from adding
a type annotation in the future. This is why I'm strongly inclined to
syntaxes that adorn the equals sign, rather than those which put
tokens elsewhere (eg "@x=[]"), because it keeps the default part
self-contained.

        Another point that I forgot to mention when replying to this before:

You are phrasing this in terms of orthogonality in argument-passing. But why think of it that way? If we think of it in terms of expression evaluation, your proposal is quite non-orthogonal, because you're essentially creating a very limited form of deferred evaluation that works only in function arguments. In a function argument, people will be able to do `x=>[]`, but they won't be able to do that anywhere else. So you're creating a "mode" for deferred evaluation.

This is why I don't get why you seem so resistant to the idea of a more general deferred evaluation approach to this problem. Generalizing deferred evaluation somehow would make the proposal MORE orthogonal to other features, because it would mean you could use a deferred expression as an argument in the same way you could use it in other places.

--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."
   --author unknown
_______________________________________________
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/2DTNRAXSNDQL24LPWXK4QO443SQD7Y3K/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to