"Structural pattern matching" for Python, part 1
"Structural pattern matching" for Python, part 1
Posted Aug 6, 2020 13:18 UTC (Thu) by jmaa (guest, #128856)Parent article: "Structural pattern matching" for Python, part 1
I love pattern matching in Standard ML/Ocaml, but can't get myself to care about it's inclusion in Python. How are you supposed to support data deconstruction, when your data can be represented in a bazillion different ways. Objects, enums, dicts, sets, lists, etc. etc. Object representation in Python honestly feels pretty bloated, and I doubt adding algebraic data types (a whole new class of types!) will help. Sure, with pattern matching, you can create functions that support all of these in turn, that's a lot of boilerplate to fix a self-created problem.
