Vote on PEP 308: Ternary Operator

Sabby and Tabby sabbyxtabby at yahoo.com
Mon Mar 3 22:34:38 EST 2003


Sheila King <usenet at thinkspot.net> wrote:

> Yes, very good idea. I actually decided to reject all preferences after
> trying them out. Reason: I might actually have to read someone's code with
> that nonsense in it some day. :(((

Nonsense is nonsense is nonsense.  Was this your vote? :)

Q accept c and x or y
Q accept (c and [x] or [y])[0]
Q accept (lambda: x, lambda: y)[not c]()
Sheila King
x = "door" + (quantity>1 and "s" or "")
data = (hasattr(s, 'open') and s.readlines() or s.split())
z = 1.0 + (abs(z) < .0001 and 0 or z)
t = v[index] = (t<=0 and t-1.0 or -sigma /(t + 1.0))
return (len(s)<10 and linsort(s) or qsort(s))

-- 
Tabby




More information about the Python-list mailing list