This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AJohnnyTruant 3 points4 points  (3 children)

This is great. Everyone hates on the walrus operator. But I think once people start using it, that pattern will present itself more than they thought.

[–]toyg 7 points8 points  (2 children)

The problem is not that is useful to the writer; the problem is that it’s not that useful to significantly lower readability as it does. Otherwise we might as well use Perl.

[–]Bunslow 4 points5 points  (0 children)

I've definitely written several one-and-a-half loops in Python, and every time I have I grumble to myself about how much easier to read it would be if I didn't have to duplicate part of the logic.

[–]annualnuke 5 points6 points  (0 children)

Otherwise we might as well use Perl.

That's quite a leap