Vote on PEP 308: Ternary Operator

Paul Moore gustav at morpheus.demon.co.uk
Sun Mar 2 15:48:04 CET 2003


pep308vote at hotmail.com (Raymond Hettinger) writes:

> BASICS
> ------
> Vote by email no later than Noon (EST) on Sunday, March 9, 2003.
> Use the following format:
>
>   To:       pep308vote at hotmail.com
>   Subject:  PEP308
>   From:     <valid email address>
>   Line 1:   <letter of most preferred format> <accept or reject> <format>
>   Line 2:   <letter of second best format> <accept or reject>  <format>
>   Line 3:   <letter of third best format>  <accept or reject>  <format>
>   Line 4:   <full name of voter>
>   Line 5:    <example 1>
>   Line 6:    <example 2>
>   Line 7:    <example 3>
>   Line 8:    <example 4>
>   Line 9:    <example 5>
>
> Every line is required.

I'm in favour of no ternary, and I can't think of 3 options I'd be
willing to have if one was forced on me (so I can't fill in lines 1-3
- I can do 2 lines, but not a third).

I don't feel this is unreasonable - if a ternary was introduced, I
simply wouldn't use it at all (my 2 votes of "reject" mean that I
might be willing to use, or at least maintain code which used, these 2
forms, in certain circumstances).

Can we allow less than 3 vote lines, please? Or have some other way of
not being forced to pick 3.

> Write-out these five examples using your most preferred syntax:
>     x = "door" + (if quantity>1: "s" else: "")
>     data = (if hasattr(s, 'open'): s.readlines() else: s.split())
>     z = 1.0 + (if abs(z) < .0001:  0 else: z)
>     t = v[index] = (if t<=0: t-1.0 else: -sigma /(t + 1.0))
>     return (if len(s)<10: insertsort(s) else: quicksort(s))
> Note, the examples are required but will not be used.
> Try to get them right, but it is okay if they are wrong.

As I don't have a "preferred syntax", this was an interesting
exercise, trying to write these using my least disliked syntax - it
confirmed to me that I'd write *all* of the examples as something
other than onel-liners.

> RATIONALE AND PROCESS
> ---------------------
> In the end, only Guido's vote counts. The purpose of the voting is
> to provide him with information about how the community feels.

In which case, how are the votes going to be summarised for him? I
assume you're not going to ask him to read all of the voting mails and
work out the implications himself?

> The goal of collecting preferences along with accept/rejects is to
> allow everyone (including those who prefer the status quo) to
> also be able to express which syntax they find least objectionable.
> The end result is that Guido will know which is the most preferred
> syntax AND the how much it is preferred to the status quo.

Um. I can't see how this will work - can you explain how the
summarising will be done? (Sorry, I have little experience with
multiple-choice voting schemes like this).

> The purpose of the examples section is voter education.  This
> provides some assurance that each voter has at least tried
> their own preferred syntax.

OK, I tried my "preferred" syntax. I didn't like it :-)

> If you make a mistake or change your mind, you may re-submit
> your vote and the previous vote will be thrown out.

For now, I've submitted a vote with a deliberately invalid line
3. I'll submit a correction if (when) you clarify how to not express a
"3rd place" fallback preference.

Paul.
-- 
This signature intentionally left blank




More information about the Python-list mailing list