Created
August 12, 2010 17:18
-
-
Save mdg/521307 to your computer and use it in GitHub Desktop.
Return a function that will return alternating items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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