Conditional operator in Python?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Sep 4 12:01:04 EDT 2001


Tue, 04 Sep 2001 08:15:12 -0700, Erik Max Francis <max at alcyone.com> pisze:

>> I think (though it would need a bit of careful checking) that
>> there is no conflict with the existing Python syntax in making
>> 
>>         if <expr> then <expr> else <expr>
>> 
>> an expression.
>> 
>> Perhaps adding this to the syntax could be a PEP?
> 
> That seems pretty reasonable to me.  I've been itching for
> a conditional operator in Python for quite some time.

The biggest problem is that 'then' is not currently a keyword.

(Or maybe a larger problem is opposition of some people which decide
or are respected in such issues...)

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list