I believe this is a different feature, non-exclusive to the one proposed here,
that would also make it possible not to re-declare keywords.
But implementing this change with the argument of making function calls less
repetitive or verbose when having redundant named keywords and variables
doesn't sell it to me.
See, function calls would still suffer to be less redundant if we go with this:
```python
def foo(a, b, **kwargs):
c = ...
bar(**{:a, :b, :c, d: kwargs["d"]}) # this just got worse
```
```python
def foo(a, b, **kwargs):
c = ...
# all parameters definition is away from the function call, not a fan
# one can possibly overwrite some key on kwarg without knowing
kwargs.update({:a, :b, :c})
bar(**kwargs)
```
```python
def foo(a, b, **kwargs):
c = ...
bar(**(kwargs | {:a, :b, :c})) # a little better but one can still
overwrite some key on kwarg without knowing
```
Using a "magical" separator does the job and has little interactions with other
syntaxes, using the `*` character seems better than just picking another random
one (like we did with `/`). Comparing with all the above excerpts, this is
still more appealing and clearer for me:
```python
def foo(a, b, **kwargs):
c = ...
bar(*, a, b, c, **kwargs) # also, if any of `a`, `b` or `c` is in `kwargs`
we get a proper error
```
Rodrigo Martins de Oliveira
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/ATCTNM5DTDTXLLCOFEHDHM7OP2MYTQDW/
Code of Conduct: http://python.org/psf/codeofconduct/