Vote on PEP 308: Ternary Operator

Sheila King usenet at thinkspot.net
Tue Mar 4 05:34:55 CET 2003


On 3 Mar 2003 19:34:38 -0800, sabbyxtabby at yahoo.com (Sabby and Tabby) wrote
in comp.lang.python in article
<f5a79bf2.0303031934.25802918 at posting.google.com>:

> 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? :)

No, the below is not my vote. I'd certainly rather you hadn't put my name
in such a bogus example, as who knows what people will make of it at a
later time on Usenet. I've removed my name from the quoted example below.

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/

> Q accept c and x or y
> Q accept (c and [x] or [y])[0]
> Q accept (lambda: x, lambda: y)[not c]()
> Someone Fictitious
> 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))





More information about the Python-list mailing list