Ternary operator

Bob Gailer bgailer at alum.rpi.edu
Mon Sep 8 14:10:10 CEST 2003


At 12:42 AM 9/8/2003, Michael Geary wrote:

> > Andrew Chalk wrote:
> > > Is there a python equivalent of the C ternery operator?
>
>Peter Hansen wrote:
> > See http://www.python.org/cgi-bin/faqw.py?query=4.16&req=search
>
>As a newcomer to Python, I found it interesting to read the PEP for this:
>
>http://www.python.org/peps/pep-0308.html
>
>In retrospect, it seems obvious that the way the voting was conducted
>insured that no ternary operator would be added to the language.
>
>There were 16 proposed syntax options, and the requirement was that a
>ternary operator would be added only if an clear majority picked a single
>one of those options.
>
>Well, with 16 options to choose from, it hardly seems surprising that none
>achieved a majority-even though several of them drew quite a few votes, and
>the most popular proposal did get more votes than the "reject all" option.
>
>Four of the options got significantly more votes than the others. Those four
>options combined got more than three times the number of votes that "reject
>all" got.
>
>It seems to me that the majority did want some kind of ternary operator, but
>the large number of options prevented any one from being the clear winner. I
>would wager that if the BDFL had picked his favorite from any of the most
>popular options and said, "Now vote yes or no on *this* syntax", he would
>have seen that clear majority he was looking for.
>
>I suppose this is all water under the bridge now, since the PEP stated that
>this was the community's one and only chance. I just can't help but think
>that the voting system guaranteed the outcome--but it's Guido's language and
>it was certainly his call to make.

THANK YOU. Your analysis of the process brings me a sense of relief. I was 
also confused and frustrated by its failure to deliver what (obviously) 
many of us wanted.

I was dismayed by the process being defined as "the community's one and 
only chance" and then set up to fail.

With the assumption that a majority of us want a ternary operator, I'd like 
to see the issue revisited with a goal of choosing an option by elimination.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003


More information about the Python-list mailing list