2 ms·
> The Walrus operator (:=) was introduced in Python 3.8, it can be useful in situations where you'd want to assign values to variables within an expression. Ok
by moffkalast 4y ago
> The Walrus operator (:=) was introduced in Python 3.8, it can be useful in situations where you'd want to assign values to variables within an expression.
Ok that is infuriating. They dragged their feet through the dirt on how the switch statement is useless and pointless, but then they add some random bullshit like that that nobody ever asked for.
- digisign 4y agoRelated, they also added a match statement with footguns. Python has "jumped the shark" in its recent envy of other languages. :-/ The existing "as" would have worked instead of walrus. I've never seen anyone use the additional flexibility that walrus affords because the code becomes too complicated and better at that point to just use two lines.