3 ms·
The example lambda isn't "golfing". It's just plain more readable than naming the function. Introducing side-effects in the middle of expressions with the wal
by wnoise 4y ago
The example lambda isn't "golfing". It's just plain more readable than naming the function.
Introducing side-effects in the middle of expressions with the walrus operator is weird semantics, though admittedly sometimes very convenient.
- xigoi 4y agoI like the walrus operator for working with the regex module. if match := re.search(r"Score = (\d+)", data): print(match[1]) else: print("Not found")