Čitavu listu promena i feature-a možete naći ovde, a autor ovog teksta izdvojio je pet za koje smatra da će imati najviše uticaja. Među njima, nalazi se i Structural Pattern Matching koji će Python-u konačno omogućiti switch-case izjave. To znači da ako želite da proverite više vrednosti, sada postoji jednostavniji način.
A new version of Python – Python 3.10.0 has been released. As usual with each Python release, there are several big topics and a couple of smaller features and in this article, we cover five which we think are going to make the biggest impact:
Structural Pattern Matching is definitely going to have the biggest impact. If you are familiar with a switch-case statement from any other language, this one is that, but on steroids. Python was not supporting switch-case statements, or similar concepts until now. There were several attempts to include this concept in the language, however, they were always rejected. The easiest way to use this new Python feature is to compare a variable with several values. There are two new keywords: match and case.