Skip to main content

Advanced parsing of structured data using Python's new match statement

UD2.218A | Day 2 | 09:00 - 09:30 | Speakers: Marc-André Lemburg

Advanced parsing of structured data using Python's new match statement
A picture of a devroom at FOSDEM 2024
Open in browser

Notes

Abstract

The match statement was introduced in Python 3.10, but has not yet seen wide adoption.

In this talk, I'd like to showcase a few more advanced use cases to demonstrate it's expressiveness and versatility, compared to classic parsers using if-elif-else chains, in the hope of attracting a few more Python users to the new concept in Python.

We will have a look at parsing JSON, XML and ASTs, and also compare performance to the classic parsing strategy.

Knowledge of how the match statement works and familiarity with at least one of JSON, XML and ASTs are prerequisite for this talk.

Speakers

Marc-André Lemburg

Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.