Skip to content

Instantly share code, notes, and snippets.

@carymrobbins
Created November 24, 2014 21:21
Show Gist options
  • Save carymrobbins/a717aaa74eb6b3cafe57 to your computer and use it in GitHub Desktop.
Save carymrobbins/a717aaa74eb6b3cafe57 to your computer and use it in GitHub Desktop.
Functional looping for Python
while_not_none = lambda x, f: (lambda fx: [] if fx is None else [fx] + while_not_none(fx, f))(f(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment