<s>[INST] Expanding tuples into arguments Is there a way to expand a Python tuple into a function - as actual parameters?
For example, here expand() does the magic:
tuple = (1, "foo", "bar")

def myfun(number, str1, str2):
    return (number * 2, str1 + str2, str2 + str1)

myfun(expand(tuple)) # (2, "foobar", "barfoo")

I know one could define myfun as myfun((a, b, c)), but of course there may be legacy code.
Thanks
 [/INST] myfun(*tuple) does exactly what you request.
Side issue: don't use as your identifiers builtin type names such as tuple, list, file, set, and so forth -- it's horrible practice and it will come back and byte you when you least expect it,
so just get into the habit of actively avoiding hiding builtin names with your own identifiers.
 </s>