Python 3.10: Structural pattern matching and other new features for data science
Oct 10, 2021
Alexander Junge
1 minute read

Structural pattern matching (aka the match statement) is a new feature introduced in Python 3.10 which was released on October 4th, 2021. A GitHub repository where I will explore and practice using structural pattern matching and other new features with data science use cases in mind is available here.

Below is an example of a match statement used to parse a messy CSV file. Time will tell how much constructs like this wild be used in production code. The match statement could be a good alternative to deeply nested if-else-blocks to achieve the same outcome.

Check the repository for more and updated examples. Any feedback or pull requests are highly appreciated.



comments powered by Disqus