Topic
Python's Match-Case Statements
By: Phil Robare
Date: Oct. 8, 2026, 6 p.m.
Five years ago, in Python 3.10, PEP 634 was added to the language giving Python a standard way to do multi-dispatch with the syntax
'''
match var:
case pattern:
...
'''
At the time it was considered quite controversial since it was felt that the syntax was just a fancy way to express if-elif-else statements. Over the intervening years it has come to be accepted as a way to show the intent of a block of code. When used it is an element that processes a series of inputs and based on pattern matches does specialized work or updates the program state.
This talk will explore the variety of pattern matching that can be done leading to a powerful expression that can be the organizing motif for program expression in some cases.