My .02 on PEP308 + an extra question.

Mel Wilson mwilson at
Mon Feb 10 23:10:53 CET 2003

In article <aeR1a.805$PC1.148 at>,
"Adonis" <adonisv at> wrote:
>How about something like:
>x = iif(cond, true, false)
>BUT, why mingle with all this when anyone can simply make it?
>>>> def iif(cond, ctrue, cfalse):
>...     if cond: return ctrue
>...     else: return cfalse
[ ... ]
>or am I getting the concept all wrong?

   You, too, are getting the concept all wrong,

    import math
    x = -1.0
    iif (x >= 0.0, math.sqrt(x), 0.0)

and see what you see.

   How many people are left out there who are still going to
think this up?

        Regards.    Mel.

More information about the Python-list mailing list