
May 4, 2021
1:40 p.m.
Most of programming languages out there have switch-case statements. Python doesn't have support for switch-case statements though. switch-case statements can sometimes be nice and tidy and sometimes it may be a horrible nightmare. But that also applies to if-elif-else statements. It would be nice to have switch-case statements support in python.
See the pattern-matching PEPs such as https://www.python.org/dev/peps/pep-0634/ In short, python soon will have a sort of switch statement, though the semantics will be a bit different and it is actually a form of pattern matching. See also the notes on pattern mathing in https://docs.python.org/3.10/whatsnew/3.10.html - DLD