Python 3.10 <https://docs.python.org/3/whatsnew/3.10.html#pep-634-structural-pattern-matching> supports the new match statement <https://peps.python.org/pep-0634/>. Don't panic, match is a "soft" keyword.
Imo, this is the coolest addition to python since acyncio: - Pep 634 <https://peps.python.org/pep-0634/> describes the feature, - Pep 635 <https://peps.python.org/pep-0635/> gives the rationale, - Pep 635 <https://peps.python.org/pep-0636/> is a tutorial. Leo issue #2541 <https://github.com/leo-editor/leo-editor/issues/2541>provides support for the required new ast parse-tree nodes. I'm still trying to get my head around the "declarative" style of pattern matching. It might be possible to improve Leo's fast-read algorithm using this feature. It *is *possible to (conditionally) use the match statement in Leo's code. The trick would be to put the new code in a separate file, say leoPython3.10.py. To use the new code, you would try to import functions from this file, falling back to legacy code if the import failed. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/69769d3d-c9ba-4fb8-b20a-db807ac86637n%40googlegroups.com.
