Skip to content

Instantly share code, notes, and snippets.

@juanarrivillaga
Created January 16, 2018 02:11
Show Gist options
  • Save juanarrivillaga/c419c6db29ada54b1a777e250cdef27f to your computer and use it in GitHub Desktop.
Save juanarrivillaga/c419c6db29ada54b1a777e250cdef27f to your computer and use it in GitHub Desktop.
def flatten(items):
for item in items:
if isinstance(item, list):
yield from item
else:
yield item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment