4 ms·
I dig it. 'as' primes my brain to something going into a scoped context.
by kortex 6y ago
I dig it. 'as' primes my brain to something going into a scoped context.
- Spivak 6y agoIt’s fine. Python just introduced expression assignment. Why not use that? match subject case [first := _, rest := _] return [rest, first]
- collyw 6y agoWell get to Perl eventually
- pfalcon 6y agoNote that the original PEP622 relied on ":=" initially, but they found some corner case with it (apparently, operator precedence related) and switched to "as" in PEP634.
- kortex 6y agoThat works too but I guess I am still getting used to the walrus operator. What really bugs me about this PEP is they are going through all this effort to introduce match but they don't have match assignments, which is personally one of my favorite things about match.