tuple-packing

Converting a list of lists to a tuple in Python

I have a list of lists (generated with a simple list comprehension): >>> base_lists = [[a, b] for a in range(1, 3) for b in range(1, 6)] >>> base_lists [[1,1],[1,2],[1,3],[1,4],[1,5],[2,1],[2,2],[2,3],[2,4],[2,5]] I want to turn this entire list into a tuple containing all of the values in the lists, i.e.: resulting_tuple = (1,1,1,2...

scala coalesces multiple function call parameters into a Tuple -- can this be disabled?

This is a troublesome violation of type safety in my project, so I'm looking for a way to disable it. It seems that if a function takes an AnyRef (or a java.lang.Object), you can call the function with any combination of parameters, and Scala will coalesce the parameters into a Tuple object and invoke the function. In my case the functi...