Why didn't Python do this:
x = if condition a else b
? x = if condition a else b
? x = -1 if y else -2
However, with your syntax, it would look like: x = if y -1 else -2
Which could be possibly confused with trying to subtract 1 from y. checkSomeValue() && doOtherThing()Variable x should be assigned if condition a true, otherwise b.
msg = if (status == 0) "done" else "error"msg = if status == 0 "done" else "error"
From a compiler perspective that's a bear to parse.