Donovan Baarda wrote:
Agreed. I don't find any switch syntaxes better than if/elif/else. Speed benefits belong in implementation optimisations, not new bad syntax.
Two things are mildly annoying about if-elif chains as a substitute for a switch statement:
1) Repeating the name of the thing being switched on all the time, and the operator being used for comparison.
2) The first case is syntactically different from subsequent ones, even though semantically all the cases are equivalent.