Re: Looking for ?: operator...

Jack Jansen (Jack.Jansen@cwi.nl)
Fri, 16 Sep 1994 09:29:25 GMT

MHammond@cmutual.com.au (Mark Hammond) writes:
>Is there something I can use similar to C's ?: operator?? I have tried
>to think of a way to coax lambda into doing it, but cant think of a
>method.

Due to the way 'and' and 'or' work you can do C?E1:E2 as:
((C and E1) or E2)

Guido'll have to say whether this is an accidental hack or Official
Python Idiom, however.

-- 
--
Jack Jansen        | If I can't dance I don't want to be part of
Jack.Jansen@cwi.nl | your revolution             -- Emma Goldman
uunet!cwi.nl!jack    G=Jack;S=Jansen;O=cwi;PRMD=surf;ADMD=400net;C=nl