Skip to content

Instantly share code, notes, and snippets.

@miodeqqq
Created April 26, 2017 09:22
Show Gist options
  • Save miodeqqq/048f27c35121b43993114c76bddb7908 to your computer and use it in GitHub Desktop.
Save miodeqqq/048f27c35121b43993114c76bddb7908 to your computer and use it in GitHub Desktop.
Merge flatten lists into the one
def flatten(x):
"""
Merges flatten lists into the one.
"""
return [a for i in x for a in flatten(i)] if isinstance(x, collections.Iterable) else [x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment