A Perfect Match The history, design, implementation, and future of Python's...
summary
Python 3.10 adds structural pattern matching as a genuine destructuring + control-flow construct rather than a switch, backed by PEPs 622/634/635/636 and a working CPython implementation that preserves existing code via soft keywords. The implementation produces new bytecode (eg optimized match_sequence and length opcodes) from a dedicated spam compiler, shows real performance gains, enables class and mapping patterns, and experiments with decision trees and unreachable-pattern warnings for future Python versions.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:19History
- 3:50Repository
- 5:32Design
- 8:22Match Statement
- 15:12Soft Keywords
- 16:42Structural Pattern Matching
- 20:12The Future
related talks
34mDynamic Pattern Matching with Python
10mAn Exploration of Python's Upcoming Match Statement
16mDynamic Pattern Matching with Python
46mSupercharge your code with Python's 'match' statement
30mAdvanced parsing of structured data using Python's new match statement
26mStructural Pattern Matching in Python
26mThe Road to Pattern Matching in Python
18mmeet the best feature in python 3.10: match-case
