Is there any value to a Switch / Case implementation in Python?
Recently, I saw some discussions online about how there is no good "switch / case" equivalent in Python. I realize that there are several ways to do something similar - some with lambda, some with dictionaries. There have been other StackOverflow discussions about the alternatives. There were even two PEPs (PEP 0275 and PEP 3103) discussing (and rejecting) the integration of switch / case into the language. I came up with what I think is an elegant way to do switch / case. It ends up looking like this: from switch_case import switch, case # note the import style x = 42 switch(x) # note the