Skip to content

Instantly share code, notes, and snippets.

@chriszf
Created November 12, 2013 08:12
Show Gist options
  • Save chriszf/7427302 to your computer and use it in GitHub Desktop.
Save chriszf/7427302 to your computer and use it in GitHub Desktop.
import lib.switchcase
def one():
print "One branch executed"
def two():
print "Two branch executed"
def three():
print "Three branch executed"
some_var = 2
switch(some_var, (one() for some_var in case(1)),
(two() for some_var in case(2)),
(three() for some_var in case(3)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment