4

What is the cleanest way to implement the following:

list = [list1, list2, ...]
return [*list1, *list2, ...]

It looks like this syntax will be available in Python 3.5. In the meantime, what is your solution?

Eric Kaschalk
  • 329
  • 1
  • 4
  • 7

1 Answers1

22

This is commonly written as:

[x for l in list for x in l]
Lynn
  • 9,609
  • 40
  • 69