anything new on the ternary operator?

John Hunter jdhunter at ace.bsd.uchicago.edu
Mon Jul 7 18:27:12 CEST 2003


>>>>> "Tim" == Tim Peters <tim.one at comcast.net> writes:

    Tim> There were many creative interpretations of the vote counts,
    Tim> but none of them showed the consensus Guido said at the start
    Tim> would be needed for adoption.

Perhaps there is a lesson for the next time a vote count comes around.
Although there wasn't a consensus on the syntactical form of a ternary
operator, there may be a consensus for the existence of one.  This
suggests a runoff step is needed

Vote 1

  0)   choice 0
  1)   choice 1
  ...
  N-1) choice N-1
  N) No ternary operator

Vote 2 if sum(votes[:N])>votes[-1]

  0) winner of vote 1
  1) No ternary operator

I suspect many of not most of those who voted for some syntax of
ternary operator would prefer the first choice of the vote rather than
no choice, even if their pet candidate didn't win.  Perhaps the python
community couldn't stand being dragged through a 2-tiered voting
procedure, but it looks like a fairer test.

John Hunter





More information about the Python-list mailing list