(no title)
Luyt
|
6 years ago
A while ago, I was also sceptical about the walrus operator, although I use assignments in expressions all the time in C++. But when I was perusing a library written Python the other day, I found five spots in which the walrus operator would make sense - eliminating one line of source code without readability suffering from it.
bakery2k|6 years ago
masklinn|6 years ago
> There should be one — and preferably only one — obvious way to do it.
Which is a very, very different assertion. And there remains one — and exactly only one — obvious way to do an assignment, because the walrus operator is literally invalid syntax as a statement:
CallocRoast|6 years ago
dr_zoidberg|6 years ago
unknown|6 years ago
[deleted]
pwdisswordfish2|6 years ago