最佳答案
                                        
                                                                        
                                是否有一种方法将Python元组扩展为函数-作为实际的参数?
例如,这里expand()发挥了魔力:
some_tuple = (1, "foo", "bar")
def myfun(number, str1, str2):
return (number * 2, str1 + str2, str2 + str1)
myfun(expand(some_tuple)) # (2, "foobar", "barfoo")
myfun定义为myfun((a, b, c)),但当然可能存在遗留代码。
由于< / p >
                     
                                
                             
                                
                             
                                
                             
                                
                             
                                
                            