Python 3.10 is finally adding some much-needed features

coding
(Image credit: Shutterstock / Elle Aon)

The next stable version of popular open source programming language, Python 3.10, has been released, bringing with it a host of new syntax and typing features that’ll appeal to long-time developers.

Python 3.10 follows the languages’ 30th anniversary earlier this year in February 2021, and though it doesn’t have a long list of new features, the latest release includes a new type union operator to help developers write cleaner code.

The developers have also polished the interpreter, in the hopes that the changes will make Python code a little easier to debug. For starters, error messages will finally point to where the error actually is, while making sure the error message is informative enough to help the developers take corrective action.

However, the big feature of the release is structural pattern matching, which reportedly grew out of earlier failed attempts to add a switch/case-like syntax to Python.

Structural pattern matching

With structural pattern matching developers can match variables against one of a set of possible values, without relying on if/else/elif blocks for handling expression values anymore. Some developers suggest that the feature can be thought of as being similar to a switch statement in C and Java.  

Interestingly however, structural pattern matching in Python also enables developers to match against patterns of values. 

The feature is implemented via a match statement that “takes an expression and compares its value to successive patterns given as one or more case blocks,” and is designed to equip developers with an easier way to extract information from complex data types.

The Python developers have explained and illustrated the feature in the release notes with relevant examples, and have also provided an in-depth tutorial to help developers get to grips with it.

Via DevClass

Mayank Sharma

With almost two decades of writing and reporting on Linux, Mayank Sharma would like everyone to think he’s TechRadar Pro’s expert on the topic. Of course, he’s just as interested in other computing topics, particularly cybersecurity, cloud, containers, and coding.

Read more
A close up of a person typing on a MacBook keyboard.
Best IDE for Python of 2025
Computer programming code. Programming code abstract technology background of software developer and Computer script.
Best text editor of 2025
The Python banner logo on a computer screen running a code editor.
Best Python online course of 2025
A laptop screen showing a ChatGPT coding panel
The ChatGPT Mac app just got a massive coding upgrade – and it’s coming to Windows soon
GIMP on a laptop
After two decades, GIMP 3.0 has arrived with high-resolution compatibility and extensive improvements
Blender 4.3
The world's most popular free 3D computer graphics tool gets a major upgrade; Blender 4.3 makes it an even more compelling alternative to more established rivals
Latest in Software & Services
woman listening to computer
AWS vs Azure: choosing the right platform to maximize your company's investment
Group of people meeting
Zoom vs Google Meet: which is the best video conferencing tool for your business?
Person at laptop
Windows 11 vs Windows 365: which is the best choice for businesses?
A man sitting at his desk in the evening and using a desktop computer
Office 2021 vs Office 2024: is it time to upgrade?
Microsoft 365 Business app logos
Office 2024 LTSC vs Microsoft 365 Business: what are the differences?
Windows 11 Start menu layout choices: Grid view
Windows 11 vs Linux for business: which operating system should you embrace?
Latest in News
Brad Pitt looks over his right shoulder with 'F1' written behind him
Apple Original Films will take you behind-the-scenes of a racing cockpit in this new thrilling F1 movie trailer
AI writer
Coding AI tells developer to write it himself
Reacher looking down at another character from the Prime Video TV series Reacher
Reacher season 3 becomes Prime Video’s biggest returning show thanks to Hollywood’s biggest heavyweight
Image showing detail of the Leica D-Lux 8
Still can't get a Fujifilm X100VI? This premium Leica compact costs less, and it's in stock
Man using iMessage on an iPhone
Apple will finally enable encrypted RCS messages between iOS and Android, and it's about time
Google Messages update
Google Messages could soon follow WhatsApp with an upgrade that makes it much easier to join group chats