> 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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/FW76I53CMJTC2HXSIAO4DAJOSBKTCZ3U/ Code of Conduct: http://python.org/psf/codeofconduct/