If uses short circuit boolean evaluation to find the first non-null string in the list. For strings, the empty string '' evaluates to False and everything other string is regarded as a True value.
Sections 5.1 and 5.2 from the documentation tell you all you need to know to understand this.
In particular:
x or y if x is false, then y, else x
This is a short-circuit operator, so it only evaluates the second argument if the first one is False.
If uses short circuit boolean evaluation to find the first non-null string in the list. For strings, the empty string '' evaluates to False and everything other string is regarded as a True value.
Sections 5.1 and 5.2 from the documentation tell you all you need to know to understand this.
In particular:
x or y if x is false, then y, else x
This is a short-circuit operator, so it only evaluates the second argument if the first one is False.
If uses short circuit boolean evaluation to find the first non-null string in the list. For strings, the empty string '' evaluates to False and everything other string is regarded as a True value.
Sections 5.1 and 5.2 from the documentation tell you all you need to know to understand this.
In particular:
x or y if x is false, then y, else xThis is a short-circuit operator, so it only evaluates the second argument if the first one is False.
If uses short circuit boolean evaluation to find the first non-null string in the list. For strings, the empty string '' evaluates to False and everything other string is regarded as a True value.
Sections 5.1 and 5.2 from the documentation tell you all you need to know to understand this.
In particular:
x or y if x is false, then y, else x
This is a short-circuit operator, so it only evaluates the second argument if the first one is False.