> This is already valid in 3.8, so we should forget about overloading := 
> with a second meaning.

def func(x=(a:=expression), y=a+1):
def func(x:=options):

These two syntaxes do not conflict with each other.

> Do we want to encourage callers to pass None to
> indicate default 
> arguments?

> Neither are we going to force function writers to accept None as a 
> default. So the way functions can be called will depend partially on the 
> function itself, and partially on the caller's personal choice for how 
> they prefer to handle defaults.

If it wasn't clear originally, I meant to ask, what is the best practice that
should be encouraged? And we're not 'forcing' anyone, we're just making
an easier syntax for doing something.

There's a thirty year tradition of doing that because there's no
terser way to do it. Out of the 85 instances I found in the STL, only 5 
instances
used "if arg is None: arg = " in one line. The others used a two-line form.
Having to read 2 lines to understand a common language pattern is inefficient.
_______________________________________________
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/VFRYCWBUXRMJFVG6PBCUK5D25M2ZUJOX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to