Hacker News new | ask | show | jobs
by fatbird 2535 days ago
The unix philosophy of simplicity was on a per tool basis, not function or line of code. The walrus operator is Python version of what we can do now in C or in JS, doing plain assignment in an expression while evaluating it for truthiness. And more often than not, the point of that single-purposeness in Unix is so you can chain a bunch of piped commands that result in a perl-like spaghetti command that's three terminal widths long.
1 comments

> while evaluating it for truthiness

no, it evaluates to the left side's value after assignment

Well, yes, that's right: the return value of an assignment expression is the left side's value, which is what makes the assignment/evaluation work.