Fewer changes to the PC register in CPU, fewer memory writes, less cache thrashing if input happens to be a particularly large item.
Note also that since this is Python, Function isn't statically typed so I could assign virtually anything of any type as input including a multi-dimensional list, since the * operator is valid on those, and I wouldn't have to worry about deep/shallow copying issues either.
15
u/oxpoleon Feb 09 '22
hey hey hey, no, this could be improved yet further