You can, but until Python 2.5 you needed to use a somewhat opaque idiom:
x + (foo and 1 or 2)
This works because the short-circuiting boolean operators return their second operand. So if foo is true, it'll evaluate 1, find that it's true, and return 1. If foo is false, it short-circuits over the 1, evaluates the 2, finds that that is a true value, and so returns 2. It's not intuitive at all, but most serious Pythonistas are familiar with it.
I agree that this is gratuitously restrictive, and evidently the Python developers did too. As of Python 2.5, you can do this:
x + (1 if foo else 2)
It's a shame that it took so long for them to add it, though.
Oddly enough, after reading his article and letting is sink in a little bit more, I was able to understand your writing better. That's no fault of yours, I just think it's a little bit of a shortcut to getting over that initial confusion.
Thanks.
For example, someone recently told me that in Python you can't have conditionals within math expressions. E.g. you can say the equiv of
(if foo (+ x 1) (+ x 2))
but not
(+ x (if foo 1 2))
To me this just seems gratuitously restrictive. But I suppose it would at least be an accurate, if rather long, description of Lisp to teach people Python, and then say e.g. "Ok, now imagine if you could also just put any expression anywhere." Plus a few other things, of course...