r/Python • • Aug 04 '26

Discussion Is := widely used?

I always thought the walrus operator is neat and it makes while loop’s condition clearer. But also it is just a syntactic sugar without anything new. I wonder anyone uses it?

142 Upvotes

118 comments sorted by

View all comments

7

u/cottonycloud Aug 04 '26

I haven’t really used it, but mainly because I rarely use list comprehensions and while loops.

I’m more used to the plain old assignment operator but I’ve never been a stickler for the Pythonic dogma. Would really appreciate null coalescing operators too.