4 ms·
I think *iterable would just pass one argument that's a list, not pass each argument individually
by drizze 9y ago
I think *iterable would just pass one argument that's a list, not pass each argument individually
- fiddlerwoaroof 9y ago>>> print([1,2,3]) [1,2,3] >>> print(*[1,2,3]) 1 2 3
- aisofteng 9y agoThat doesn't tell you anything about when the list is expanded.
- dragonwriter 9y agoThe 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.)
- orf 9y agoThere may be some optimization at the interpreter level, but it appears to Python that each element of 'iterable' is passed as an individual argument