if does not evaluate

Jim Newton jimka at rdrop.com
Sat Jun 5 07:27:40 EDT 2004


A question that has bothered me ever since looking at python
the first time is that not everything evaluates to something.
I am wondering what is the reason for this.  Would making
everying evaluate have caused the langugage to be less
efficient execution-wise?  or was it a choice to enforce some
sort of standard?

I've read a few discussions about the fact that there is
no if/then/else operartor.

Wouldn't this problem be easily solved by making the built
in keywords actually be evaluatable.

I.e.,  x = if something:
               expr1
            else:
               expr2

parentheses would of course be optional as they are for
all expressions.




More information about the Python-list mailing list