Skip to content

Instantly share code, notes, and snippets.

@mdg
Created August 12, 2010 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdg/521307 to your computer and use it in GitHub Desktop.
Save mdg/521307 to your computer and use it in GitHub Desktop.
Return a function that will return alternating items
# Return a function that will return alternate items and a new function
def make_toggler(a,b):
return lambda: (a, make_toggler(b,a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment