For review: PEP 308 - If-then-else expression
Roy Smith
roy at panix.com
Fri Feb 7 23:42:36 EST 2003
All of the syntaxes proposed in the PEP look pretty horrible to me. The
"expression if ...." stuff is just plain horrible. It's totally
confusing and inconsistant. If I wanted stuff like that, I'd be writing
in perl.
I've been using python for about 6 years now. I must admit that at
first I missed the :?, but over the years my desire for it has mellowed.
I still think I'd like to see something with that functionality in the
language, but not at the cost of any of the aberations proposed in the
PEP.
Of the suggestions in the PEP, the function call "x = ifelse (cond,
exp1, exp2)" seems the least bad. It does suffer from the lack of
short-circuit behavior, but most of the time, you can live with that.
More information about the Python-list
mailing list