The following syntax looks very handy in many case.
1 | Python 3.7.3 (default, Mar 27 2019, 09:23:15) |
I can understand what does those code try to do easily. Yeah, this is the magic of Python. :-)
But I had a hard time to find the semantic explanation for the syntax.
I was thinking about
Arbitrary Argument Lists
But this is not function signature. AndArbitrary Argument Lists
will construct*args
as atuple
rather than alist
.Unpacking Argument Lists
As the name suggested, this syntax unpacking a list or tuple rather than create a new list.
Extended Iterable Unpacking
This is a new feature introduced in Python 3.0
I believe the posted code is already explained the usage of this syntax. Find more details from PEP 3132