Ate there any good reasons to assign things in an if statement?
The walrus is for giving names to values you were computing anyway. Instead of a storage bin and the value you want to store there, the walrus involves a value and the name you want to refer to it by. Conceptually, the value is where you begin.
EDIT: Based the examples given, the Python := operator doesn't appear to behave as a let binding. The scoping suggests it is another form of assignment.
while (item := stack.pop()) is not None:
# ...
is a lot harder to get wrong than item = stack.pop()
while item is not None:
# ...
item = stack.pop()
Really wish it was scoped though...Edit: Just realised you were asking for an if-statement... but I think this is still a valid point.
if x := 3:
print("x is now: ", x)
print("x isn't scoped to the if:",x)