3 ms·
what do you mean by pattern matching in python 3? the only thing that sounds similar is (nested) iterable unpacking: (a, (b, c)) = foo() (fst, *middle, las
by uryga 7y ago
what do you mean by pattern matching in python 3? the only thing that sounds similar is (nested) iterable unpacking:
(a, (b, c)) = foo()
(fst, *middle, last) = foo()
which is nice but i wouldn't really call it pattern matching because i can't do something like
match xs:
when (): ...
when (x, *rest): ...
i.e. do different things based on the shape of the data.