Skip to content

Instantly share code, notes, and snippets.

@o11c
Created May 6, 2017 05:12
Show Gist options
  • Save o11c/8e8f3d40160d9b4c6d841dc071535364 to your computer and use it in GitHub Desktop.
Save o11c/8e8f3d40160d9b4c6d841dc071535364 to your computer and use it in GitHub Desktop.
def give_me_a_switch(args):
sense = False
for a in args:
switch a:
case '+':
sense = True
case '-':
sense = False
case 'a':
a.x = sense
case 'b':
b = Foo(sense)
lots_of_code(a, b, ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment