Python v3.10 will support switch statements

Rejoice! Gone are the long chains of if…else statements, because switch statements will soon be here — sort of. What the Python gods are actually giving us are match statements. match statements are awfully similar to switch statements, but have a few really cool and unique features, which are explained in the linked article.

The big new feature seems to be pattern matching with comparisons versus just integral values. This probably adds no advantages in speed but may make human reading of long statements a bit easier.

See Python Will Soon Support Switch Statements

#technology #coding #programming #python

Image/photo

Rejoice! Gone are the long chains of if…else statements, because switch statements will soon be here — sort of. What the Python gods are actually giving us are match statements. match s…