Python Core Developers Release Version 3.10 -- First Major Release Since Transition from Python 2

ZDNet reports:

“Python 3.10.0 is the newest major release of the Python programming language, and it contains many new features and optimizations,” CPython maintainers announced in a blogpost

One of the headline features is “structural pattern matching” in Python 3.10 – a technique for handling data that’s already available in C, Java, JavaScript, Scala and Elixir. “Structural pattern matching has been added in the form of a match statement and case statements of patterns with associated actions. Patterns consist of sequences, mappings, primitive data types as well as class instances. Pattern matching enables programs to extract information from complex data types, branch on the structure of data, and apply specific actions based on different forms of data,” the project explains in release 3.10 notes. “While structural pattern matching can be used in its simplest form comparing a variable to a literal in a case statement, its true value for Python lies in its handling of the subject’s type and shape,” it adds.

Python core contributors presented the update in a meeting this week. Pablo Galindo Salgado, a physicist and core Python contributor, explained how the project is using Microsoft’s GitHub Actions DevOps (CI/CD) tools to test Python changes on Windows, Linux and macOS systems. “When you merge something to Python, there is a CI in GitHub Actions, and we have other providers, although we are mainly using GitHub Actions now. It tests your commits on every single commit on Linux, Windows, and macOS,” said Salgado.
Besides better error messages (including more precise and reliable line numbers for debugging), other changes to the language include overloading the pipe operator to allow a new syntax for writing union types, and type aliases (a kind of user-specified type, offering a way to explicitly declare an assignment as a type alias).

7 Likes