PEP 308: "then" "else" for deprecating "and" "or" side effect s

Daniel Silva dsilva at ccs.neu.edu
Fri Feb 14 18:34:14 EST 2003


>> Just because it uses lazy evaluation doesn't mean it isn't a function.

> I disagree. To me, the semantics of function call is well-defined
> in Python. It works the same way for all functions, and that way
> is to NOT do lazy evaluation. A form like  if(cond,A,B)  which looks
> like a function except for using a keyword seems to me like it would
> be confusing precisely BECAUSE it looks like a function, but it's
> behavior is (subtly) different.

what's wrong with it looking like a function if the docs specify it as a 
special form?  cond( test1: expr1, test2: expr2, test3: expr3, true: e4 ) 
could work too, which could be built from if( test, then, else ).
You could even do the cond in Python once you have a syntax and 
expander system, just hide the system from the user so they don't change 
the language...

- Daniel




More information about the Python-list mailing list