On Mon, 23 Nov 2020 16:15:12 -0000
"Brian Coleman" <brianfcole...@gmail.com> wrote:
> 
> Furthermore, Python has a regular expression module which implements it's own 
> DSL for the purpose of matching string patterns. Regular expressions, in a 
> similar way to pattern matching,
>   allow string patterns to be expressed in a concise and declarative manner.

Uh, without regular expressions, a lot of functions would be massively
more complicated and annoying to write.

However, your example shows that pattern matching barely makes
common code shorter (admittedly, on this _one_ example, but that's the
one you chose ;-)).

While I agree that regular expressions are far less Pythonic than the
proposed variant of pattern matching, they also have a tremendously
better cost/benefit ratio, IMHO.

Regards

Antoine.

_______________________________________________
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/45MP5EZ4D4XIJAQR2WPXLXNMWOMAR3QT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to