Ternary operator

John Roth newsgroups at jhrothjr.com
Mon Sep 8 13:16:12 EDT 2003


"Paul Moore" <pf_moore at yahoo.co.uk> wrote in message
news:4qznp862.fsf at yahoo.co.uk...
> Bob Gailer <bgailer at alum.rpi.edu> writes:
>
> >>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.
>
> Actually, that's what Guido did do at first (IIRC). He proposed the
> "expr1 if cond else expr2" form. The *community* argued against this
> specific syntax, rather than concentrating on the semantics, and it
> was only then that the discussion fragmented into endless discussions
> over what syntax to choose.
>
> >>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.
>
> The voting system was designed by the community and so we can't blame
> anyone but ourselves for "rigging" the outcome...

I don't remember it that way. The way I remember it, it showed up one
day as a statement by someone that they were going to list all of the
suggestions so we could vote on it. There was some discussion of how
to vote, but before that I don't remember any discussion of structure.

It seems to me that the process was the typical "here's how I think it
should be done, and I'm willing to do all the work to make it happen,"
followed by a fair number of people not saying that they thought it was
a terminally stupid idea. You don't, after all, want to discourage
volunteers who actually want to work.

> > 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.
>
> My feeling is that there is a majority who want a ternary operation
> (not including me, but what the heck) but that there is violent
> disagreement on the syntax.

There were also a lot of people who were fed up with the endless
debate, too.

The biggest difficulty, IMNSHO, was debating specific proposals
rather than debating constraints. If you debate constraints first, then
you can evaluate specific proposals against the constraints. That process
usually iterates to a conclusion rather swiftly.

However, I don't know how to make that shift in a public forum
such as c.l.py.

> > I was dismayed by the process being defined as "the community's one
> > and only chance" and then set up to fail.
>
> Well, I see it as Guido not really wanting to spend the time
> implementing a ternary operator. He offered to, in any case, if the
> community was in favour (and the PEP originally stated precisely what
> he was offering). But with the proviso "if you don't like this, I'm
> not going to offer again". I doubt he was surprised that the result
> was a lot of discussion over syntax, rather than an acceptance of the
> offer.
>
> The general history of this issue is one of endless discussion with no
> agreement. Maybe the majority would like the feature, but that same
> majority can't agree on syntax. The PEP just forced one more iteration
> of that process, and documented the result (lots of heated discussion,
> but no solid conclusion).
>
> Maybe it's a shame that Guido's original PEP wasn't preserved
> unaltered. What's there now doesn't capture the flavour of the
> original.

Agreed. There may be a copy floating around in someone's archives,
though. I'm not interested enough in assigning blame to go hunting,
we need a way to move forward that will get to a real agreement.

> Of course, all of this is only my recollection, and just as prone to
> being wrong as anyone else's...

Likewise.

John Roth
>
> Paul.
> -- 
> This signature intentionally left blank






More information about the Python-list mailing list