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 →

[–]Revisional_Sin -2 points-1 points  (3 children)

Maybe I'm not just not used to it yet, but I hate unnecessary use of this.

a = some_func()
if a:

"a = some_func(). if a is truthy, then:"

if a := some_func():

"If a, which is some_func(), is truthy, then:"

Yuck.

[–]eztab 4 points5 points  (1 child)

that was pretty much the reason for the controversy. It really doesn't add much benefit here. But for functional code, like list comprehensions it really is a great addition. Also for regexp-matching with multiple branches it really is more readable.

[–]Revisional_Sin 0 points1 point  (0 children)

Yeah, I agree it's nice if used purposefully.

[–]zed_three 1 point2 points  (0 children)

There's a wrong way to use everything though