Get the latest tech news

Crimes with Python's Pattern Matching (2022)


Let's make the CPython team regret adding pattern matching to Python!

It can only match on an object’s type, meaning we have to make a separate ABC for each thing we want to test. CPython assumes that people don’t want to shove side effects into esoteric corners of the language. This kind of chicanery might have a place in the dark beating heart of a complex library, certainly not for any code your coworkers will have to deal with.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of python

python

Photo of crimes

crimes

Related news:

News photo

Python f-string cheat sheets (2022)

News photo

Show HN: PlutoPrint – Generate PDFs and PNGs from HTML with Python

News photo

PYX: The next step in Python packaging