Re:What’s New in Python 3.7
by drizze on Sunday September 17, 2017 @11:19AM
(#15269993)
I think *iterable would just pass one argument that's a list, not pass each argument individually
[ Parent
| on HN ]
There may be some optimization at the interpreter level, but it appears to Python that each element of 'iterable' is passed as an individual argument
Re:What’s New in Python 3.7
by fiddlerwoaroof on Sunday September 17, 2017 @11:22AM
(#15270001)
>>> print([1,2,3])
[1,2,3]
>>> print(*[1,2,3])
1 2 3That doesn't tell you anything about when the list is expanded.
Re:What’s New in Python 3.7
by dragonwriter on Sunday September 17, 2017 @11:22AM
(#15270003)
The asterisk at the call site (where it turns an iterable into multiple passed arguments) not the function definition site (where it collects otherwise unconsumed arguments into a single list.)