I learned everything about the match statement so you don't have to
summary
Shows concrete code: builds Circle, Rectangle and Square classes and implements an area method for shapes and a point-in-shape containment using positional matches, demonstrating match_args, capture names, star and star-star captures, and the walrus operator. Compares line-for-line with equivalent if chains, highlights when match simplifies type, sequence and mapping checks, and warns it doesn’t replace every if. Examples run live and produce working outputs so viewers can reuse patterns immediately.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:45Python match statement
- 1:51Match vs if statements
- 2:37Matching constants and types
- 3:43Capturing matches and defaults
- 4:45Walrus operator in matches
- 5:27Matching sequences
- 6:31Advanced mapping and set matching
- 7:36Matching with classes
- 10:41Q&A
related talks
26mThe Road to Pattern Matching in Python
42mMatch Case for Beginners
10mAn Exploration of Python's Upcoming Match Statement
53mWhat C# Programmers Need to Know About Pattern Matching
46mSupercharge your code with Python's 'match' statement
26mStructural Pattern Matching in Python
30mAdvanced parsing of structured data using Python's new match statement
16mDynamic Pattern Matching with Python
