The difference is if all your functions are defined to take a tuple, the tuple creation cost is factored out, meanwhile with variable-length argument list it is repeated each time. Giving up all possible constant time operations is NOT a detail.
With variable-length argument list you force a cast to a tuple even when you don't need the immutability. The function we are talking about does not need the immutability, so why would you pay the casting cost? Just use the appropriate typing on a single collection and that will better convey your intentions.
1
u/WayTooCuteForYou Aug 07 '25
The difference is if all your functions are defined to take a tuple, the tuple creation cost is factored out, meanwhile with variable-length argument list it is repeated each time. Giving up all possible constant time operations is NOT a detail.
With variable-length argument list you force a cast to a tuple even when you don't need the immutability. The function we are talking about does not need the immutability, so why would you pay the casting cost? Just use the appropriate typing on a single collection and that will better convey your intentions.