dbrattli / Expression

Pragmatic functional programming for Python inspired by F#
https://expression.readthedocs.io
MIT License
421 stars 30 forks source link

PEP634 - Structural Pattern Matching Suport? #83

Closed lucasteles closed 2 years ago

lucasteles commented 2 years ago

Will we have support for Option and Result with PEP634 ?

dbrattli commented 2 years ago

I think for most part it should work, but I'm not sure you will be able to unwrap the option/result to get the inner value. But please try to make some examples and submit as a PR. PEP634 is not a matching protocol which would have made it easier for us (if it had been).

dbrattli commented 2 years ago

This will be fixed in the next release

dbrattli commented 2 years ago

@lucasteles Thanks for asking about this. I decided to remove the legacy custom pattern matching in favor of python 3.10. Expression should be lot better because of this. I'm upgrading all projects to use Python 3.10 because of this.