Comment by ghxst
Why would you do this over `return key, value` which produces a tuple? Just curious.
Why would you do this over `return key, value` which produces a tuple? Just curious.
To quote the Zen of Python:
Explicit is better than implicit.
Readability counts.
"return key, value" is implicit. While "return [key, value]" is explicitly telling the full return-value. And it's (for me) more readable than "return (key, value)".
"return (key, value)" can be read as a function-call. Especially as space after the function-name is allowed in python. And performance on that level is no serious topic in python anyway. But this is mainly just a personal preference.
Not the parent, but i return heterogeneous lists of the same length to the excel to be used by xlwings. The first row being the headers, but every row below is obviously heterogeneous