I want to add a table with a list of returned functions, some of them are tuples:
def get_foo_bar():
This gives:
>>> table [[('foo', 'bar'), 'apple']]
But I need the returned tuple to be unpacked into this list, for example:
[['foo', 'bar', 'apple']]
Since unpacking the function call [*get_foo_bar()] will not work, I assigned two variables to get the tuple values ββand added them instead:
foo, bar = get_foo_bar() table.append([foo, bar, get_apple()])
It works, but can it be avoided?
source share