4 ms·
> yes, I though Python had pattern matching compared to Java. Python doesn't have pattern matching at all though, and doesn't advertise such a feature. It has
by masklinn 11y ago
> yes, I though Python had pattern matching compared to Java.
Python doesn't have pattern matching at all though, and doesn't advertise such a feature. It has iterables unpacking.
- rdtsc 11y agoYou are right. I was saying that coming from C, it seemed like pattern matching and a really cool feature. Until someone found how pattern matching works in Erlang or Haskell. Even in Python to its credit, iterable unpacking pretty nifty. It can now even do stuff like: https://www.python.org/dev/peps/pep-3132/ https://www.python.org/dev/peps/pep-3132/ >>> a, *b, c = range(5) >>> a 0 >>> c 4 >>> b [1, 2, 3]