▲ | mdaniel 3 days ago | |
"beautiful" is a bit of a stretch. I am completely open to the fact that doing it in a Pythonic way would make the grammar angry but things have gone off the rails when one needs to introduce a 2nd assignment operator into a language
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
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... |