Musings on Python's Pattern Matching
Pattern Matching is coming to Python, and I am not sure I like it. Don’t get me wrong, I love pattern matching. I use it all the time in F#. I am sure that once it lands in the language, it will be wildly adopted. So what’s the problem with Python’s pattern matching? The community, some core developers included, has expressed several concerns. The Python Steering Council has acknowledged them and is willing to look into improvements should they be proposed. I am not going into the details here. You can look them up yourself. Let’s just say that there are a few gotchas, like the requirement to use dotted names as constants, to prevent them from being interpreted as capture variables instead (doh!) The lack of local scope bites hard here. ...