FWIW, Qualified +1 on PEP-0308

Craeg K Strong cstrong at arielpartners.com
Fri Feb 28 23:05:17 CET 2003


I would like to register another +1 vote for an if-then-else expression 
in Python,
specifically for Christian Tismer's proposed variant:

       <condition> then <expression1> else <expression2>

   The advantages are simple visual parsing, no required parenthesis,
   no change in the semantics of existing keywords, not as likely
   as the proposal to be confused with statement syntax, and does
   not further overload the colon.  The disadvantage is the
   implementation costs of introducing a new keyword.  However,
   unlike other new keywords, the word "then" seems unlikely to
   have been used as a name in existing programs.

The argument against it, the cost of implementation, is mostly 
irrelevant. It is incurred only once, and by the suppliers, not by the 
All the other advantages of the syntax trump the other proposals.

Many thanks,

--Craeg Strong

Craeg K Strong, General Partner
Ariel Partners LLC
voice 781-647-2425
fax   781-647-9690

More information about the Python-list mailing list