Thanks for the link! That covers my use cases, although I prefer
Apparently why they didn't use
Quick snippet:
as
over :=
...Apparently why they didn't use
as
over :=
is discussed here: https://www.reddit.com/r/Python/comments...ly/e1pfzgv Quick snippet:
Quote:The reason why they didn't is because this had to work in logical expressions, and from a parsing standpoint, it would be extremely difficult to determine the assignment expression in the context manager of a comprehension containing the expression, and the assignment of the context manager itself.