The expression x or y first evaluates x; if x is
true, its value is returned; otherwise, y is evaluated and the
resulting value is returned.
In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false: False, None, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true.
(Note that or does not restrict the value and
type it returns to False and
True, but rather return the
last evaluated argument. This is sometimes useful, e.g., if s is a
string that should be replaced by a default value if it is empty,
the expression s or 'default' yields the desired
value.)