Hello developers.
I like star expression.
It would be even better if we could extend the idea of PEP448 to
provide the following syntax at the time of assignment.
``` python
a, b, d, **_ = **{"a":0, " b":1, "c":2}, d=3
```
Ideally, it would be nice to be able to provide the same syntax when
calling the function.
I think this applies to the zen of python called "There should be
one-- and preferably only one --obvious way to do it.".
``` python
a, *args, b, **kwargs = 1, 2, *[3,4], **{"b", 4}, c=4
(
a: str,
*args,
b: list = [],
**kwargs
) = 1, 2, *[3,4], **{"b", 4}, c=4
func = lambda(
a: str,
*args,
b: list = [],
**kwargs
): print(a, b)
```
But it would be difficult because it would conflict with various
syntaxes(etc. PEP 3132).
We may have to declare it explicitly to avoid confusion.
For example, prepare a keyword for unpack the positional arguments and
keyword arguments at the same time.
```
a, *args, b, **kwargs = ***(1, 2, *[3,4], **{"b", 4}, c=4)
```
You can now explicitly recognize that you are using the behavior of
the new assignment.
I hope this is an idea to develop python.
Thanks.
_______________________________________________
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/TQ4SDXUCLXKHFM4YOSZSVLC32UFS6MIT/
Code of Conduct: http://python.org/psf/codeofconduct/