flatten list of list through list comprehension

No-one has given the usual answer:

def flat(l):
  return [y for x in l for y in x]

There are dupes of this question floating around StackOverflow.

Leave a Comment