▲ | pansa2 3 months ago | |
I think for someone with a basic knowledge of both languages, the Ruby version is more understandable than the Python. It's a combination of basic Ruby features, whereas Python's `match` statement is much more obscure - it isn't really Python at all, it's "a DSL contrived to look like Python [...] but with very different semantics" [0]. I don't particularly love the Ruby code either, though - I think the ideal implementation would be something like:
[0] https://discuss.python.org/t/gauging-sentiment-on-pattern-ma... |