
On Sun, Apr 19, 2020 at 11:49 AM Steven D'Aprano <steve@pearwood.info> wrote:
On Sun, Apr 19, 2020 at 10:19:41AM +0200, Alex Hall wrote:
But the problem here is not that your proposal doesn't meet all the requirements, it's that you have different requirements from us. You are requiring something that looks like an expression even if it isn't.
Please read what I said again, because that's a mischaracterisation of what I said.
I don't think it is. You said 'it ought to be something "like" an expression', and then that actually being an expression is not essential. How is it unfair to rephrase that as "something that looks like an expression even if it isn't"? Note the 'if' - I didn't say "something that looks like an expression but isn't". I did say that shortly after, but that's specifically referring to your current proposal, of which I think it's a fair description.
Side note: what does this mean in your proposal? I'm guessing it's a SyntaxError?
foo(a, b, **{u, v}, c, d)
Yes, because we still have a restriction that positional arguments come before keyword arguments. If that restriction is ever relaxed, then this may become legal.
So, as Dominik pointed out, why keep this restriction? Why not say that every lone name after the `**` is an auto-named keyword? What is the advantage of being able to turn the mode off with `}`? More concretely, what is the advantage of your proposal in these pairs? ``` foo(bar, spam=True, **{thing, stuff}) foo(bar, spam=True, **, thing, stuff) foo(bar, spam=True, **{thing, stuff}, other=False) foo(bar, spam=True, **, thing, stuff, other=False) foo(bar, spam=True, **{thing, stuff}, other=False, **{baz}) foo(bar, spam=True, **, thing, stuff, other=False, baz) ```