HackerTrans
TopNewTrendsCommentsPastAskShowJobs

fqll100

no profile record

comments

fqll100
·vor 5 Jahren·discuss
"It’s tempting to think of pattern matching as a switch statement on steroids. However, as the rationale PEP points out, it’s better thought of as a “generalized concept of iterable unpacking”."

This is the problem with the recently added features in Python. As the author of the blog post correctly notes, the features are unintuitive and full of special cases.

You always have to know and recreate the steps that the unpacking machinery takes, there is nothing logical and declarative like in the ML family languages.

Pattern matching in SML or OCaml is simple and obvious.

These features are added to Python in order to give an impression that some "development" is happening. With the benefit that they prevent implementations like PyPy from catching up. Meanwhile a non-existing vaporware JIT from Microsoft is pushed as the future.