Conditional operator in Python?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Sep 4 18:50:48 CEST 2001


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

> Maybe something like
> 
> 	if X return Y else Z

Or
    if (X) Y else Z
which looks like statement if without colons (but parens are required).

> I wouldn't be averse to introducing a new keyword for this purpose,
> but if that's the stumbling block, it seems that a preexisting
> keyword can be used in this context that will work just as well.

At least I don't see other problems (and other than "it's unnecessary
feature bloat").

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



More information about the Python-list mailing list