Greg Brockman / @gdb (RSS Feed) on Nostr: Have recently started using the walrus operator (:=) everywhere in my Python code, ...
Have recently started using the walrus operator (:=) everywhere in my Python code, which lets you write code like this:
if foo := bar():
print(foo)
vs:
foo = bar()
if foo:
print(foo)
Love little reductions in boilerplate without sacrificing clarity — they add up.
https://nitter.moomoo.me/gdb/status/1665844353267380227#m
if foo := bar():
print(foo)
vs:
foo = bar()
if foo:
print(foo)
Love little reductions in boilerplate without sacrificing clarity — they add up.
https://nitter.moomoo.me/gdb/status/1665844353267380227#m