Pattern matching (Python 3.10+) ¶
-
https://realpython.com/python310-new-features/#structural-pattern-matching
-
https://www.python.org/dev/peps/pep-0636/ (Structural Pattern Matching: Tutorial)
-
https://www.python.org/dev/peps/pep-0635/ (Structural Pattern Matching: Motivation and Rationale)
-
https://www.python.org/dev/peps/pep-0634/ (Structural Pattern Matching: Specification)
-
https://docs.python.org/3.10/whatsnew/3.10.html#pep-634-structural-pattern-matching
-
https://ep2021.europython.eu/media/conference/slides/5tcgQpi-pattern-matching-in-python.pdf
-
https://discuss.python.org/t/gauging-sentiment-on-pattern-matching/5770
-
Tutorials
- Brandt Bucher: A Perfect Match The history, design, implementation, and future of Python’s.
- Alexander Hultnér Get started with Pattern Matching in Python, today!
- Python Match Case is more powerful than you think 🐍🕹️ by https://fediverse.org/guilatrova
- inspired Python
- All The Important Features and Changes in Python 3.10 by Martin Heinz
-
Pattern matching tutorial for Pythonic code
- Pre-introduction
- Introduction
- Structural pattern matching Python could already do
- Your first match statement
- Pattern matching the basic structure
- Matching the structure of objects
- __match_args__
- Wildcards
- Plain dictionary matching
- Naming sub-patterns
- Traversing recursive structures
- Careful with the hype
- Conclusion
- References
- Pattern matching tutorial by Raymond Hettinger
- Structural Pattern Matching Comes to Python 3.10.0