Woah, this is both exciting and scary.  If adopted, it will be a major change to how Python programs are written.  It seems a lot of work has been put into polishing the design.  That's good because if we do this, will not be easy to fix things later if we made design errors.

One of my first thoughts is this sounds similar to Clojure's "spec"[1].  Are the pattern matching PEP authors aware of it?  I don't mean we need to copy what spec does (really, I'm not all that familiar with it).  I do notice that spec patterns are not just used for case statement de-structuring.  Maybe we should think about a future Python that would use similar patterns for those things too.  I believe "spec" has been in use for a number of years and so the Clojure community has useful experience with the design.

An example of something "spec" does and this proposal agrees on is the matching of mappings.  I.e. that if there are additional key/value pairs, they don't cause the match to fail by default. That's important for loose coupling between systems.


[1] https://clojure.org/about/spec

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/HEPSCFLR7ONEDUMCX7MRFBH7A3CVYCUJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to