问题:
This question already has an answer here: 这个问题已经在这里有了答案:
- What does ** (double star/asterisk) and * (star/asterisk) do for parameters? **(双星号/星号)和*(星号/星号)对参数有什么作用? 19 answers 19个答案
- asterisk in function call 3 answers 函数调用中的星号 3个答案
What does the *
operator mean in Python, such as in code like zip(*x)
or f(**k)
? *
运算符在Python中的含义是什么,例如zip(*x)
或f(**k)
?
- How is it handled internally in the interpreter? 在解释器内部如何处理?
- Does it affect performance at all? 它会影响性能吗? Is it fast or slow? 是快还是慢?
- When is it useful and when is it not? 什么时候有用,什么时候没有?
- Should it be used in a function declaration or in a call? 应该在函数声明中还是在调用中使用它?
解决方案:
参考一: https://stackoom.com/question/CG6Z/在函数调用中-星号运算符是什么意思-重复参考二: https://oldbug.net/q/CG6Z/What-does-the-star-operator-mean-in-a-function-call-duplicate
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4283328