JSON Baumgartner@jasonbaumgartneHow to flatten a Python list faster than itertools and blow people's minds: li = [(1,2),(3,4),(5,6)] flattened = list(sum(li,())) > [1,2,3,4,5,6] #python9:22 AM · Nov 4, 2018·Twitter Web Client1 Retweet10 Likes
Nick Edgar@nedgar·Nov 10, 2018Replying to @jasonbaumgartneCool, but repeated tuple/list concats doesn’t scale: O(N^2)