I am surprised that the walrus operator had to do with Guido's resignation. The walrus operator is awesome. There are so many cases you need a temporary variable in a control flow. The walrus is a beautiful way to handle it.
replies(4):
if ma = re.search(needle, haystack):
print("ok, things are sane")
I cannot think of a stellar reason why assignment shouldn't be an expression in sane languages. While digging up the grammar[1] I was also reminded that walrus is seemingly incompatible with type annotations, too >>> if (x: str := re.sub("a", "b", "abc")):
File "<python-input-8>", line 1
if (x: str := re.sub("a", "b", "abc")):
^
SyntaxError: invalid syntax
Also, you say "temporary variable" but it's no more temporary than any other local variable, because lexical scoping is evidently for childrenI have always hated that comprehension variables leak for that same reason
1: https://github.com/python/cpython/blob/v3.13.7/Grammar/pytho...