Skip to content

Instantly share code, notes, and snippets.

@dalejung
Created July 15, 2015 16:27
Show Gist options
  • Save dalejung/ce03d33d0f1b6767ad9c to your computer and use it in GitHub Desktop.
Save dalejung/ce03d33d0f1b6767ad9c to your computer and use it in GitHub Desktop.
data = [1,2,3,[4,5,6,[77,88]]]
def run_through(data):
for x in data:
if isinstance(x, list):
yield from run_through(x)
continue
yield x
it = run_through(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment