Python will support Pattern Matching
After some discussions, the Python steering committee accepted the proposal to add pattern-matching to Python. The specific situation is to adopt PEP 634, 635, and 636, and reject PEP 640 and 642.
For a long time, the Python community has put forward various suggestions for the realization of specified multi-branch conditions in the Python language (similar to the switch statement in C/C++), but none of the proposals can be finally implemented. In the past 8 months or so, the Python community discussed a proposal that might solve the multi-branch condition problem (or even more) and was adopted the pattern matching suggestions (PEP 634, 635, and 636). Examples are as follows:
In the email, the Python steering committee believes that this feature requires comprehensive documentation and specifications, including the tutorial part of the documentation and language reference, and the documentation must be sent with Python 3.10, so 3.10 will not be released until this content is completed. At the same time, the steering committee stated that it rejected PEP 640 and 642 that tried to improve pattern matching due to the lack of support from core developers.
In addition, although it has been determined so far, before the functional freezing point of Python 3.10 (see PEP 619 for the schedule of 3.10), developers can still submit changes to pattern matching, including accepted PEP 634 and rejected PEP 640, 642.