The Road to Pattern Matching in Python
summary
Explains why pattern matching becomes a new statement with match and case are soft keywords, shows the concrete one-line area example that both selects branch and extracts radius/width/height, gives deterministic binding rules — e.g. all simple names are binding targets and each alternative must bind the same variables exactly once — and sketches extensibility via custom match methods so classes can expose alternative views of objects.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:50Three Main Tasks of Pattern Matching
- 4:53Early Beginnings of Pattern Matching
- 7:44Conditional Unpacking
- 20:01Names in Patterns
- 21:56Example a Complex Number
related talks
16mDynamic Pattern Matching with Python
34mDynamic Pattern Matching with Python
10mAn Exploration of Python's Upcoming Match Statement
26mStructural Pattern Matching in Python
42mMatch Case for Beginners
24mA Perfect Match The history, design, implementation, and future of Python's...
46mSupercharge your code with Python's 'match' statement
53mWhat C# Programmers Need to Know About Pattern Matching
