>
> I’m not sure if this would work out the same way or not. And even if it
> does, that hurdle of describing the syntax in a way that people won’t get
> confused the way they do when they first learn the feature in C++ might be
> hard to overcome. But it’s at least plausible that it could be readable and
> learnable enough.
>

I'm not sure what's hard to explain.

"""
When you see a function call like this:

foo(bar, *, spam, baz)

with an asterisk (*) sitting on its own looking like an argument, it's a
shorthand for this:

foo(bar, spam=spam, baz=baz)

Every argument after the asterisk gets turned into a keyword argument where
the argument name is the same as the variable name, i.e. <name>=<name>.

In a function *definition* (as opposed to a call), an asterisk sitting on
its own between parameters has a different meaning, but there are
similarities: every parameter after the asterisk is a keyword parameter.
"""
_______________________________________________
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/UPWGYD6GEDS6V75NF3MR4UOLQLSSTTGL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to