On 17.04.20 23:18, Andrew Barnert via Python-ideas wrote:
On Apr 17, 2020, at 13:39, Alex Hall <alex.mojaki@gmail.com> wrote:

I also find the example with :keyword a bit jarring at first glance, so I propose a double colon to alleviate the problem if we go in that direction. Compare:

    { :a, "b": x, :c }
    { ::a, "b": x, ::c }

I can see the point of explicitly calling out the syntax like this, and, while it doesn’t really feel necessary to me, it doesn’t feel at all onerous either. So if there are people who feel strongly against the single colon and like the double colon, I’m fine with the double colon.

(I’m still not sure we need to do anything. And I don’t love extending dict displays, and think that if we do need a solution, maybe there’s a better one lurking out there that nobody has hit on. But I definitely dislike extending dict displays less than extending some but not other uses of **unpacking, or having a mode switch in the middle of call syntax, or anything else proposed so far.)

It's been a lot of emails, so I probably missed it, but could you summarize your objections regarding the idea using `**` as a "mode switch". That is

    func(pos, **, foo, bar)

I think it aligns nicely with the `*` in function definitions. `def func(a, *, b, c)` or `def func(a, *args, b, c)` means anything following the `*` part is a keyword-only parameter. Similarly we have today `func(a, **kwargs, b=b, c=c)`, i.e. anything that follows the `**` part has to be provided as a keyword argument. Since this eliminates all ambiguity, why not leave out the parameter names: ` func(a, **kwargs, b, c)`; and since unpacking is not necessarily required, we could have `func(a, **, b, c)`.

Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/DS4HBKMMRSV6KQ6QHLS5GNTM5RG4SUXR/
Code of Conduct: http://python.org/psf/codeofconduct/