I came across a very nasty example of the if - else operator in Python where the code looked good but the result was completely different than expected. Here is a short version:
1 + 4 if None else 3 # returns 3
Looking at the Operator Precedence table in the documentation, it seems that if - else has almost the lowest precedence.
Is there anything special with if - else that treats everything on the left side of the if as one expression?
4regardless of+and?:'s relative priority.