A lump of sugar, please?

Michael Abbott michael.g.abbott at ntlworld.com
Mon Jul 23 15:07:34 EDT 2001


While we're adding things to the language, I wonder if I could ask that

    	if expr1 then expr2 else expr3

be treated as an expression equivalent to

    	((expr1 and [expr2]) or [expr3])[0]


I haven't checked the syntax in any detail, but I think that the new 'then' 
keyword allows my if expression to be mixed safely with if statements.



More information about the Python-list mailing list