|
|
|
|
|
by ggm
2068 days ago
|
|
Always wanted a switch coding style. Now, offered one i am having second thoughts introspecting if my code improves for readability if I use one. I think on balance yes. I've always like this approach to a single value or expression gating choices. Also wondering about the degenerate forms of fall through alternates, so it's a stack of code optionally run. There is another link to c code switches and duffs device in hn recently |
|
def http_error(status):
Also, method polymorphism always seemed more powerful and intuitive to me than switch statements when the operation is something like: