A use case for Python assignment expressions
Python 3.8 (2019) added “assignment expressions”, aka the “walrus operator”.
I generally like things that make Python more expression-oriented, like list comprehensions, but I’m ambivalent about these. It’s pretty easy to impair readability by using them overzealously. Is saving one line of code worth making it harder to notice that an assignment is happening?
However, I’ve found a use case I like a lot. I use them in the Django Python shell when doing exploratory ORM queries.