In both cases, "foo" continues to exist after the "if" even though the second example makes it look like "foo" is scoped to the "if".
So to my eye, the following would look super weird (assume do_more_stuff can take None):
if foo := one_or_none(): do_stuff(foo) do_more_stuff(foo)
foo = one_or_none() if foo: do_stuff(foo) do_more_stuff(foo)
In both cases, "foo" continues to exist after the "if" even though the second example makes it look like "foo" is scoped to the "if".
So to my eye, the following would look super weird (assume do_more_stuff can take None):
whereas the following would look fine: