Is it considered bad style to assign values to variables like this?
x = "foobar" or None
y = some_variable or None
In the above example, x gets the value 'foobar'.
No, it's a common practice. It's only considered bad style for expressions that are considerably longer than yours.