A = X > Y ? X : Y
sabren at manifestation.com
Thu Feb 10 07:23:38 CET 2000
Bob Alexander wrote in message
<00e401bf7332$4aea6ea0$74eb0b18 at stcla1.sfba.home.com>...
>It can't be encapsulated into something that looks like a function call
I betcha it can!... How about this?
def cStyleIIF(condition, iftrue, iffalse):
x = 5
y = 20
a = cStyleIIF("x<y", "x", "y")
You've got some extra overhead there, but if you really
want to do this on one line without evaluating both options
or using boolean short circuits, it might be worth it... :)
More information about the Python-list