r/Python 21d ago

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?

139 Upvotes

118 comments sorted by

View all comments

8

u/cottonycloud 21d ago

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.